File: forminfo.c

package info (click to toggle)
oleo 1.6-16
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,640 kB
  • ctags: 3,139
  • sloc: ansic: 39,221; yacc: 1,737; sh: 362; makefile: 88
file content (1365 lines) | stat: -rw-r--r-- 37,874 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
/*	Copyright (C) 1993 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software; see the file COPYING.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */


#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "sysdef.h"
#include "forminfo.h"

char * formula_info[] =
{
   /* Syntax advice */
"*number-syntax*",
"Numbers must be entered in 'general' format:",
"	[-]digits[.digits][e[-]digits]",
0,
"*string-syntax*",
"Strings are entered surrounded by double-quotes.  To include unusual",
"characters, you can either quote them with backslash ",
"(e.g. \"a \\\"quoted\\\" quote\") use \\nnn where nnn is the octal code for",
"the character you want to include. ",
0,
"*expression-syntax*",
"			Infix expressions:",
"",
"- num			0-num",
"! bool			#TRUE if bool is #FALSE",
"			#FALSE if bool is #TRUE, error otherwise.",
"",
"num1 ^ num2		Exponentiation  This is *right* associative!",
"num1 * num2		Multiplication  Note that these functions are not as",
"num1 / num2		Division	good as they should be at detecting",
"int1 % int2		Modulus		overflow.  There *is* code that should",
"",
"num1 + num2		Addition	force integer expressions to become",
"num1 - num2		subtraction	floating-point if the result wouldn't",
"					fit in an integer.",
"num1 >= num2		Arithmatic greater-or-equal",
"num1 > num2		greater-than",
"num1 < num2		less-than",
"num1 <= num2		less-than-or-equal",
"",
"val1 = val2		#TRUE if val1 and val2 can be considered equal.",
"			#FALSE otherwise",
"val1 != val2		Equivalent to !(val1=val2)",
"",
"str1 & str2		Text concatination.",
"",
"bool ? val1 : val2	if(bool==#TRUE)",
"				evaluate val1",
"			else if(bool!=#FALSE)",
"				error...",
"			else",
"				evaluate val2.",
"",
"(val)			(To override default precedence) Note that since oleo",
"			stores expressions in a byte-compiled form, excess",
"			parens will mysteriously vanish.",
0,


	/* Error values. */

"#TRUE",
"The logical TRUE value",
0,
"#FALSE",
"The logical FALSE value",
0,
"#ERROR",
"An unclassified error.",
0,
"#BAD_INPUT",
"Indicates an inappropriate parameter to a formula function.",
0,
"#NON_NUMBER",
"An error value.",
0,
"#NON_STRING",
"An error value.",
0,
"#NON_BOOL",
"An error value.",
0,
"#NON_RANGE",
"An error value.",
0,
"#OUT_OF_RANGE",
"An error value.",
0,
"#NO_VALUES",
"An error value.",
0,
"#DIV_BY_ZERO",
"An error value.",
0,
"#BAD_NAME",
"An error value that indicates an invalid variable name.  ",
"It may be the symptom of an incorrectly written address.",
0,
"#NOT_AVAIL",
"An error value.",
0,
"#PARSE_ERROR",
"An error value.",
0,
"#NEED_OPEN",
"An error value that indicates a missing open parenthesis.",
0,
"#NEED_CLOSE",
"An error value that indicates a missing close parenthesis.",
0,
"#NEED_QUOTE",
"An error value.",
0,
"#UNK_CHAR",
"An error value.",
0,
"#UNK_FUNC",
"An error value.",
0,
"#INF",
"An error value.",
"On some machines this may be indistinguishable from other values.",
0,
"#INFINITY",
"An error value.",
"On some machines this may be indistinguishable from other values.",
0,
"#NAN",
"An error value.",
"On some machines this may be indistinguishable from other values.",
0,
"#NOT_A_NUMBER",
"An error value.",
"On some machines this may be indistinguishable from other values.",
0,
"#NINF",
"An error value.",
"On some machines this may be indistinguishable from other values.",
0,
"#MINUS_INFINITY",
"An error value.",
"On some machines this may be indistinguishable from other values.",
0,



		/* Functions releated to boolean values. */

"if",
"Conditional operator			if(bool,val1,val2)",
"",
"If BOOL is #TRUE, the value is VAL1;",
"if BOOL is #FALSE, the value is VAL2;",
"if BOOL is neither #TRUE or #FALSE, then the value is #NON_BOOL",
0,
"and",
"Boolean operator			and(bool1,bool2)",
"",
"If both BOOL1 and BOOL2 are #TRUE, the value is #TRUE;",
"otherwise, if both are boolean values, the value is #FALSE;",
"otherwise, the value is #NON_BOOL.",
0,
"or",
"Boolean operator			or(bool1,bool2)",
"",
"If both BOOL1 and BOOL2 are booleans, then the value is #TRUE if either",
"argument is #TRUE, and #FALSE if both are #FALSE.",
"If either argument is not a boolean, the value is #NON_BOOL.",
0,
"not",
"Boolean operator			not(bool)",
"",
"#TRUE if BOOL is #FALSE,",
"#FALSE if BOOL is #TRUE, ",
"and otherwise, #NON_BOOL.",
0,
"iserr",
"Error predicate				iserr(val)",
"",
"#TRUE if the VAL is an error, otherwise #FALSE",
0,
"isnum",
"Number predicate			isnum(val)",
"",
"#TRUE if the VAL is a number, or can be automatically converted to a number.",
"Thus `isnum(\"12\")' is #TRUE, while `isnum(\"dsfjbk\") is #FALSE.",
0,


	/* Functions that reflect the structure of the spreadsheet. */
"row",
"A cell's row address			row()",
"",
"The row number of the cell the expression is in.",
0,
"col",
"A cell's column address		col()",
"",
"The column number of the cell the expression is in.",
0,
"rows",
"Rows in a range			rows(rng)",
"",
"The number of rows in RNG.",
0,
"cols",
"Columns in a range			cols(rng)",
"",
"The number of columns in RNG.",
0,
"my",
"Cell reflection				my(str)",
"",
"The function `my' returns information about the cell containing the formula.",
"The argument STR is a key to say what should be returned.  Valid arguments are:",
"",
" KEY		RETURNS",
"",
"row		row address (as an integer)",
"column		column address (as an integer)",
"width		width, (as an integer)",
"lock		\"locked\" or \"unlocked\"",
"protection	(this is a synonym for \"lock\")",
"justify		\"left\", \"right\", \"center\" or \"default\"",
"alignment	(this is a synonym for \"justify\")",
"format		\"default\", \"user-1\", etc.",
"fmt		(this is a synonym for \"format\")",
"type		\"error\", \"boolean\", \"float\",\"integer\", \"null\", \"Unknown\", etc.",
"formula		A string of the cell's current formula.",
"value		The cells current value.",
"anything-else	error--> #BAD_INPUT",
0,
"curcell",
"Reflection on the current cell		curcell(str)",
"",
"Curcell takes the same arguments as `my', but returns information about the ",
"current location of the cell-cursor, instead of the cell containing this",
"formula.",
"",
"Curcell is updated on a timer interrupt.",
0,
"cell",
"General cell reflection			cell(row,col,str)",
"",
"`Cell' takes a ROW and COL address, and a STR that is like an argument to `my'.",
"It returns information about the cell at ROW,COL.",
0,
"member",
"Search for values			member(rng,val)",
"",
"Returns the index of the first cell in RNG that contains VAL, or zero",
"if no cells contain it.  It is permissable for VAL to be an error",
"value.",
0,
"smember",
"Search for a substring			smember(rng,str)",
"",
"Returns the index of the first cell in RNG that contains STR as a substr.",
"Returns 0 if no cells match.  If STR is empty, then it matches an",
"empty cell (see also `members').",
0,
"members",
"Search for a substring			members(rng,str)",
"",
"Returns the index of the first  cell in RNG that contains STR as a substr.",
"Returns 0 if no cells match.  This function will never return the",
"address of an empty cell, but see `smember'.",
0,
"pmember",
"Search for an initial substring		pmember(rng,str)",
"",
"Returns the index of the first cell in RNG whose value equals the",
"first few characters of STR.  If STR is empty, an empty cell may be",
"matched (but see `memberp').",
0,
"memberp",
"Search for an initial substring		memberp(rng,str)",
"",
"Returns the index of the first cell in RNG whose value equals the",
"first few characters of STR.  This function will never return the",
"address of an empty cell, but see `pmember'.",
0,
"hlookup",
"Number-keyed table lookup		hlookup(rng,num,int)",
"",
"Scan through the top row of RANGE looking for a number which is",
"greater than NUM.  Then return the value in the cell that is INT rows",
"down from the top of the range.",
0,
"vlookup",
"Number-Keyed table lookup		vlookup(rng,num,int)",
"",
"Scan through the left col of RANGE looking for a number which is",
"greater than NUM.  Then return the value in the cell that is INT cols",
"over from the left edge of the range.",
0,
"vlookup_str",
"String-keyed table lookup		vlookup_str(rng,str,num)",
"",
"Scan through the left col of RANGE looking for a cell that contains",
"STR.  Then return the value in the cell that is INT columns over from",
"the left edge of the range.",
0,
"now",
"Time of day				now()",
"",
"The current time in seconds since Jan 1 1970.",
0,

"ctime",
"The current time of day			ctime(num)",
"",
"Convert NUM into a readable date/time string.",
"NUM should be seconds since the epoch; as returned by `now()' for example.",
0,
"index",
"Table lookup				index(rng,x), index(rng,relrow,relcol)",
"",
"In the first form, the contents of a cell in RNG, at offset X.  The lookup is",
"in the first column (though it may wrap to other columns).",
"",
"In the second form, the contents of a cell in RNG, RELROW rows and RELCOL",
"columns from the upper left corner of the range.",
0,



	/* General arithmetic*/

"abs",
"Absolute value				abs(num)",
"",
"The absolute value of NUM.",
0,
"int",
"Convesion to integer			int(num)",
"",
"Convert NUM to integer (toward zero).  ",
"See also `floor', and `ceil'.",
0,
"ceil",
"Conversion to integer			ceil(num)",
"",
"Convert NUM to integer (round up).",
"See also `floor', and `int'.",
0,
"floor",
"Conversion to integer			floor(num)",
"",
"Convert NUM to integer (round down)",
"See also `ceil', and `int'.",
0,
"fixed",
"Fixed decimal rounding			fixed(num1,num2)",
"",
"NUM1 rounded to NUM2 decimal places.",
0,
"rnd",
"Random integer				rnd(num)",
"",
"A random integer from 0 to NUM-1.",
0,
"negate",
"Negation				negate(num)",
"",
"Equivalent to `0 - NUM'.",
0,




"exp",
"Exponential				exp(num)",
"",
"The exponential function of NUM.",
0,
"log",
"Log					log(num)",
"",
"The natural log of NUM.",
0,
"log10",
"Log base 10				log10(num)",
"",
"The log of NUM to base 10.",
0,
"sqrt",
"Square root				sqrt(num)",
"",
"The square-root of NUM.",
0,



/* Trig functions */

"pi",
"Constant				pi()",
"",
"3.14159265358979326848",
0,
"acos",
"Arc cosine				acos(num)",
"",
"The arc cosine (in radians) of NUM.",
0,
"asin",
"Arc sine				asin(num)",
"",
"The arc sine (in radians) of NUM.",
0,
"atan",
"Arc tangant				atan(num)",
"",
"The arc tangent (in radians) of NUM.",
0,
"cos",
"Cosine					cos(num)",
"",
"The cosine of NUM (NUM in radians)",
0,
"dtr",
"Degrees to radians			dtr(num)",
"",
"NUM degrees converted to radians.",
0,
"rtd",
"Radians to degrees			rtd(num)",
"",
"NUM radians converted to degrees.",
0,
"sin",
"Sine					sin(num)",
"",
"The sine of NUM (NUM in radians).",
0,
"tan",
"Tangent					tan(num)",
"",
"The tangent of NUM (NUM in radians).",
0,
"atan2",
"Expanded arc tangent			atan2(num1,num2)",
"",
"Returns the arc tangent (in radians) of NUM1 / NUM2.",
"The range of atan2 is (-pi..pi).  The quadrant of the angle returned",
"is determined by the signs of NUM1 and NUM2:",
"",
"	            (pi/2)",
"		       |",
"              NUM2 < 0 |  both > 0",
"		       |",
"   (pi,-pi) -------------------------- (0)",
"              both < 0 |  NUM1 < 0",
"		       |",
"		       |",
"	           -(pi/2)",
0,
"hypot",
"Length of t he hypoteneus		hypot(num1,num2)",
"",
"Returns `sqrt (NUM1 * NUM1 + NUM2 * NUM2)'.  ",
"",
"Calling `hypot' may succeed in cases when the equivalent expression",
"might underflow or overflow.",
0,

"oneof",
"Case expression				oneof(choice,val1,val2,val3...)",
"",
"If CHOICE is 1, return VAL1, if 2, VAL2, and so forth.",
"If CHOICE is not a valid integer in the appropriate range, the value is",
"#OUT_OF_RANGE.  If no value arguments are supplied, the value is #NO_VALUES.",
0,

"sum",
"Sum of values				sum(vr1, vr2, ...)",
"",
"The sum of VR1, VR2, etc.  ",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
"",
"If none of the arguments include valid numbers (e.g. `sum(r1:10c1:10)'",
"where that range is empty), then the value is #NO_VALUES.  To ensure",
"that the expression doesn't return an error in cases like that,",
"provide a default value as an extra argument to sum",
"(e.g. `sum(0,r1:10c1:10)').",
0,
"prod",
"Product of values			prod(vr1, vr2, ...)",
"",
"The product of VR1, VR2, etc.  ",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
"",
"If none of the arguments include valid numbers (e.g. `prod(r1:10c1)'",
"where that range is empty), then the value is #NO_VALUES.  To ensure",
"that the expression doesn't return an error in cases like that,",
"provide a default value as an extra argument to product (e.g. `prod(1,",
"r1:10c1)').",
0,

"avg",
"Average					avg(vr1...)",
"",
"The average of VR1, VR2, etc.  ",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
"",
"If none of the arguments include valid numbers (e.g. `avg(r1:10c1)'",
"where that range is empty), then the value is #NO_VALUES.",
0,
"std",
"Standard deviation			std(vr1...)",
"",
"The SAMPLE standard deviation.  ",
"To get the population standard deviation, use sqrt(var(...))",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
"",
"If none of the arguments include valid numbers (e.g. `avg(r1:10c1)'",
"where that range is empty), then the value is #NO_VALUES.",
0,
"max",
"Maximum					max(vr1...)",
"",
"Return the maximum value of all the arguments.",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
"",
"If none of the arguments include valid numbers (e.g. `max(r1:10c1)'",
"where that range is empty), then the value is #NO_VALUES.  To ensure",
"that the expression doesn't return an error in cases like that,",
"provide a default value as an extra argument to maximum (e.g. `max(0,",
"r1:10c1)').",
0,
"min",
"Minimum					min(vr1...)",
"",
"Return the minimum value of all the arguments.",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
"",
"If none of the arguments  include valid numbers (e.g. `min(r1:10c1)'",
"where that range is empty), then the value is #NO_VALUES.  To ensure that the",
"expression doesn't return an error in cases like that, provide a default value",
"as an extra argument to minimum (e.g. `min(99999, r1:10c1)').",
0,
"cnt",
"Count numbers				cnt(vr1...)",
"",
"The number of numeric values found amongst the arguments.",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
0,
"var",
"Population variance			var(vr1...)",
"",
"The population varianc of the arguments.",
"",
"Each value can be either a numeric type or a range.  If the value is a range, ",
"the values of all numeric cells in that range are used.",
"",
"To get the sample variance, use std(...)^2",
0,

  	/* string functions */
"len",
"String length				len(str)",
"",
"The number of characters in STR.",
0,
"strlwr",
"Conversion to lower case		strlwr(str)",
"",
"STR, converted to lower case.",
0,
"strupr",
"Conversion to upper case		strupr(str)",
"",
"STR, converted to upper case.",
0,
"strcap",
"String capitalization			strcap(str)",
"",
"STR, with each word capitalized.",
0,
"trim",
"String beautifier			trim(str)",
"",
"STR, with extra spaces and non-ascii characters removed.",
0,
"find",
"find(str1,str2,int)",
"",
"Return the location after INT where STR2 appears in STR1.",
0,
"substr",
"Extract substring by position		substr(int1,int2,str)",
"",
"Extract the substring from INT1 to INT2 of STR.",
"",
"Positive indexes are counted from the beginning of STR, starting with 1.",
"Negative indexes are counted from the end of STR, starting with -1.",
"See also, `mid'.",
0,
"mid",
"Extract substring by extent		mid(str,int1,int2)",
"",
"The characters in STR from INT1 and continuing for INT2 characters.",
"INT1 is counted from the beginning of the string, starting with 1.",
"See also, `substr'.",
0,
"edit",
"Delete part of a string			edit(str,int1,int2,...)",
"",
"Return STR with chars INT1 through INT2 removed.",
"INT1 and INT2 behave as with `substr'.",
0,
"repeat",
"Construct a repeated string		repeat(str,int)",
"",
"Return INT concatenations of STR; thus repeat(\"foo\",2) returns \"foofoo\".",
0,
"concat",
"Concatenate string 			concat(vr1,...)",
"",
"Return the concatenation of all strings in the arguments.",
"An argument may be a range, in which case the cell values in the range are",
"concatenated.",
0,


	/* busy-ness functions */
"pmt",
"Loan payments			pmt(p,r,t)",
"",
"Payment per period for a loan of principle P at rate R for T payments.",
0,
"pv",
"Present value of investment	pv(pmt,int,term)",
"",
"Present value of an investment that pays $PMT at the end of each of",
"TERM periods with a discount rate (interest) of INT.",
0,
"npv",
"Net present value		npv(rng,rate)",
"",
"Net Present Value of an investment which will pay uneaven payments.",
"The term is calculated from the number of cells in RNG.",
0,
"irr",
"Intrenal rate or return		irr(rng,guess)",
"",
"Internal Rate of Return.  This function is paticularly untested, and",
"should not be trusted.",
"",
"Returns #BAD_INPUT if it does not converge for the given input.",
0,
"fv",
"Future value of an annuity	fv(pmt,int,term)",
"",
"Future Value of an annuity.",
0,
"rate",
"rate(fut,pres,term)",
"",
"Interest rate required to turn $PRES into $FUT in TERM periods.",
"",
0,
"term",
"term(pmt,int,fut)",
"",
"Number of periods required to collect $FUT in payments of $PMT, where",
"depositd payments earn at a rate of INT.",
0,
"cterm",
"cterm(int,fut,pres)",
"",
"Number of periods required to collect $FUT from a single initial",
"deposit of $PRES, at an interest rate of INT.",
"",
0,
"sln",
"sln(cost,scrap,life)",
"",
"Straight line depreciation of an asset that cost",
"$COST when new, can be sold for $SCRAP, and will last for LIFE",
"periods.",
"",
0,
"syd",
"syd(cost,scrap,life,per)",
"",
"Sum-of-the-digits depreciation of an asset that cost $COST, can be",
"sold for $SCRAP and lasts LIFE, in period PER.",
0,
"ddb",
"ddb(cost,scrap,life,per)",
"",
"Double-declining-balance deprecion, otherwise similar to syd().",
0,
"anrate",
"anrate(pmt,pres,term)",
"",
"(undocumented -- documentation from volunteers welcome).",
0,
"anterm",
"anterm(pmt,prin,rate)",
"",
"(undocumented -- documentation from volunteers welcome).",
0,
"balance",
"balance(prin,rate,term,period)",
"",
"(undocumented -- documentation from volunteers welcome).",
0,
"paidint",
"paidint(prin,rate,term,period)",
"",
"(undocumented -- documentation from volunteers welcome).",
0,
"kint",
"kint(prin,rate,term,period)",
"",
"(undocumented -- documentation from volunteers welcome).",
0,
"kprin",
"kprin(prin,rate,term,period)",
"",
"(undocumented -- documentation from volunteers welcome).",
0,
"compbal",
"compbal(print,rate,term)",
"",
"(undocumented -- documentation from volunteers welcome).",
0, 

			     /* Date functions */
"hms_to_time",
"hms_to_time(hours, minutes, seconds)",
"",
"Convert HOURS, MINS, and SECS to a time value (a number of seconds).",
0,
"dhms_to_time",
"dhms_to_time(days, hours, minutes, seconds)",
"",
"Convert DAYS, HOURS, MINS, and SECS to a time value (a number of seconds).",
0,
"time_to_d",
"time_to_d(time)",
"",
"Return the number of days in TIME.  (TIME should be a number of seconds).",
0,
"time_to_h",
"time_to_h(time)",
"",
"Return the number of hours in TIME.  (TIME should be a number of seconds).",
"The return value will be in the range 0..23.",
0,
"time_to_m",
"time_to_m(time)",
"",
"Return the number of minutes in TIME.  (TIME should be a number of seconds).",
"The return value will be in the range 0..59.",
0,
"time_to_s",
"time_to_s(time)",
"",
"Return the number of seconds in TIME.  (TIME should be a number of seconds).",
"The return value will be in the range 0..59.",
0,
"ymd",
"ymd(year, month, day)",
"",
"Convert YEAR, MONTH, and DAY to a time value (a number of seconds).",
"Typicly the return value is the number of seconds since January 1, 1970.",
"The conversion assumes the local time zone.",
0,
"ymd_dst",
"ymd_dst(year, month, day, dst)",
"",
"Convert YEAR, MONTH, DAY and DST to a time value (a number of seconds).",
"Typicly the return value is the number of seconds since January 1, 1970.",
"The conversion assumes the local time zone except that daylight savings",
"time is assumed if dst is positive and stanard time is assumed if DST",
"is 0.  If DST is less than 0, this is the same as ymd(year,month,day).",
0,
"local_year",
"local_year(time)",
"",
"For a time (e.g., returned by now()) return its year in the local timezone.",
0,
"local_month",
"local_month(time)",
"",
"For a time (e.g., returned by now()) return its month in the local timezone.",
0,
"local_date",
"local_date(time)",
"",
"For a time (e.g., returned by now()) return its date in the local timezone.",
0,
"local_hour",
"local_hour(time)",
"",
"For a time (e.g., returned by now()) return its hour in the local timezone.",
0,
"local_min",
"local_min(time)",
"",
"For a time (e.g., returned by now()) return minutes in the local timezone.",
0,
"local_sec",
"local_sec(time)",
"",
"For a time (e.g., returned by now()) return seconds in the local timezone.",
0,
"local_isdst",
"local_isdst(time)",
"",
"For a time (e.g., returned by now()) return dst in the local timezone.",
"The return is positive if dst is in effect, 0 otherwise.",
0,
"local_yday",
"local_yday(time)",
"",
"For a time (e.g., returned by now()) give day-of-year in the local timezone.",
"The return value is in the range 0..364 (0..365 for leapyears)",
0,
"local_wday",
"local_wday(time)",
"",
"For a time (e.g., returned by now()) return day (0-6) in the local timezone.",
0,
"gmt_year",
"gmt_year(time)",
"",
"For a time (e.g., returned by now()) return its year in Greenwich.",
0,
"gmt_month",
"gmt_month(time)",
"",
"For a time (e.g., returned by now()) return its month in Greenwich.",
0,
"gmt_date",
"gmt_date(time)",
"",
"For a time (e.g., returned by now()) return its date in Greenwich.",
0,
"gmt_hour",
"gmt_hour(time)",
"",
"For a time (e.g., returned by now()) return its hour in Greenwich.",
0,
"gmt_min",
"gmt_min(time)",
"",
"For a time (e.g., returned by now()) return minutes in Greenwich.",
0,
"gmt_sec",
"gmt_sec(time)",
"",
"For a time (e.g., returned by now()) return seconds in Greenwich.",
0,
"gmt_isdst",
"gmt_isdst(time)",
"",
"For a time (e.g., returned by now()) tell if it's dst in Greenwich.",
"The return is positive if dst is in effect, 0 otherwise.",
0,
"gmt_yday",
"gmt_yday(time)",
"",
"For a time (e.g., returned by now()) the day-of-year (0-365) in Greenwich.",
0,
"gmt_wday",
"gmt_wday(time)",
"",
"For a time (e.g., returned by now()) return the day (0-6) in Greenwich.",
0,
"get_date",
"get_date(date_string)",
"",
"Parse a date and return its time (seconds since epoch).",
"The syntax of dates is the same as is understood by GNU tar or GNU date.",
0,
"posix_date",
"posix_date(posix_date_string)",
"",
"Parse a date and return its time (seconds since epoch).",
"The syntax of dates follows the Posix standard (as understood by GNU date).",
0,
"strftime",
"strftime(format_string, time_val)",
"",
"Return a string according to FORMAT describing TIME (as returned by now()).",
"The format string may contain these escape codes:",
"",
"This function is implemented by the C library function strftime.",
"The following documentation describes the GNU implementation of strftime.",
"Your version of Oleo may have been built with a different version, in",
"which case, you can find documentation in the strftime man page.",
"(In the future this anomoly will be removed).",
"",
"Performs `%' substitutions similar to those in printf.  Except",
"where noted, substituted fields have a fixed size; numeric fields are",
"padded if necessary.  Padding is with zeros by default; for fields",
"that display a single number, padding can be changed or inhibited by",
"following the `%' with one of the modifiers described below.  Unknown",
"field specifiers are copied as normal characters.  All other",
"characters are copied to the output without change.",
"",
"Supports a superset of the ANSI C field specifiers.",
"",
"Literal character fields:",
"%	%",
"n	newline",
"t	tab",
"",
"Numeric modifiers (a nonstandard extension):",
"-	do not pad the field",
"_	pad the field with spaces",
"",
"Time fields:",
"%H	hour (00..23)",
"%I	hour (01..12)",
"%k	hour ( 0..23)",
"%l	hour ( 1..12)",
"%M	minute (00..59)",
"%p	locale's AM or PM",
"%r	time, 12-hour (hh:mm:ss A/PM)",
"%R	time, 24-hour (hh:mm)",
"%S	second (00..61)",
"%T	time, 24-hour (hh:mm:ss)",
"%X	locale's time representation (%H:%M:%S)",
"%Z	time zone (EDT), or nothing if no time zone is determinable",
"",
"Date fields:",
"%a	locale's abbreviated weekday name (Sun..Sat)",
"%A	locale's full weekday name, variable length (Sunday..Saturday)",
"%b	locale's abbreviated month name (Jan..Dec)",
"%B	locale's full month name, variable length (January..December)",
"%c	locale's date and time (Sat Nov 04 12:02:33 EST 1989)",
"%C	century (00..99)",
"%d	day of month (01..31)",
"%e	day of month ( 1..31)",
"%D	date (mm/dd/yy)",
"%h	same as %b",
"%j	day of year (001..366)",
"%m	month (01..12)",
"%U	week number of year with Sunday as first day of week (00..53)",
"%w	day of week (0..6)",
"%W	week number of year with Monday as first day of week (00..53)",
"%x	locale's date representation (mm/dd/yy)",
"%y	last two digits of year (00..99)",
"%Y	year (1970...)",

0,


"help-with-help",
"",
"Valid help characters are:",
"",
"c  -- 	describe-character-briefly",
"	Type a command key sequence; it prints the function name that",
"	sequence runs.",
"f  --  describe-function",
"	Type a function name and get full documentation for that function.",
"F  --  describe-formula",
"	Type the name of a formula function, and get full documentation.",
"k  --	describe-key",
"	Type a command key sequence and get full documentation for the",
"	function that sequence runs.", 
"o  --  show-options",
"	Print the current settings of all user options.",
"v  --  show-variable",
"	Type a variable name and get it's binding.",
"^v --  show-all-variables",
"	Print a list of all variables and their bindings.",
"w  --	where-is",
"	Type a command name and get a keysequence that invokes that command.",
"W  --  view-wallchart",
"	Display a list of keybindings.",
"^W --  print-wallchart",
"	Write a list of keybindings to a file.",
0,
"graphing",
"",
"[graph-presets-verbosely]	--  Reset graphing parameters to default values.",
"[graph-clear-verbosely]	--  Clear the datasets of their assigned ranges.",
"[graph-select-output]	--  Choose the output type for graphs.",
"[graph-set-data]	--  Assign a range of data to a dataset in the graph.",
"[graph-verify]	--  Verify graph parameters.",
"[graph-plot]	--  Plot with the current parameters.",
"",
"The following control optional parameters:",
"",
"[graph-x-axis]	--  Define parameters relating the X axis.",
"[graph-y-axis]	--  Define parameters relating the Y axis.",
"[graph-set-data-title]	--  Assign a title to a dataset.",
"[graph-set-style]	--  Assign a style to a dataset.",
"",
"Esc	--  End this command.",
0,
"graph-x-axis-help",
"",
"[graph-set-x-range-low]	--  Set the beginning of the range of the X axis.",
"[graph-set-x-range-high]	--  Set the end of the range of the X axis.",
"[graph-set-x-axis-symbolic]	--  Specify a symbolic range for X.",
"[graph-set-x-labels]	--  Provide labels for tic marks on the X axis.",
"[graph-default-x-labels]	--  Use the default tic marks on the X axis.",
"",
"",
"Esc	--  End this command.",
0,
"graph-y-axis-help",
"",
"[graph-set-y-range-low]	--  Set the beginning of the range of the Y axis.",
"[graph-set-y-range-high]	--  Set the end of the range of the Y axis.",
"[graph-set-y-labels]	--  Provide labels for tic marks on the Y axis.",
"[graph-default-y-labels]	--  Use the default tic marks on the Y axis.",
"",
"Esc	--  End this command.",
0,
"graph-output-types",
"",
"[graph-x11-mono]	--  Draw the graph in an X window, in black and white.",
"[graph-x11-color]	--  Draw the graph in an X window, in color.",
"[graph-postscript]	--  Write a file of postscript commands that draw that graph.",
0,
"keybindings-wallchart",
"",
"			   General Utility",
"[[main]]",
"Abort the current command, or partial keysequence	[break]",
"Set repeat counts and other prefix arguments		[universal-argument]",
"Jane, stop this crazy thing				[kill-oleo]",
"Redraw the screen					[redraw-screen]",
"Suspend Oleo						[suspend-oleo]",
"Call a command by name					[execute-command]",
"Recalculate						[recalculate]",
"",
"",
"			    Help Commands",
"",
"Describe key briefly	[describe-key-briefly]",
"Describe key		[describe-key]",
"Describe function	[describe-function]",
"Describe formula	[describe-formula]",
"Where is		[where-is]",
"",
"",
"When a complex command is being invoked (i.e., when Oleo is prompting",
"you for arguments), the next command displays documentation for the",
"command being invoked.  This can often be used to get more information",
"about what is being prompted for:",
"",
"Help with command	[help-with-command]",
"",
"",
"",
"			  Cell Cursor Motion",
"",
"Every window has it's own cell cursor.  The most recently used window",
"defines the current cell position.  There is one cell marker, global to ",
"the spreadsheet.",
"",
"Move the cell cursor to a specific address		[goto-cell]",
"Set the cell cursor and the cell mark			[goto-region]",
"",
"Set the cell mark to the current cell			[mark-cell]",
"(to set the cell cursor equal to the mark, and clear the mark,",
" use `[universal-argument][mark-cell]').",
"",
"Exchange the cell cursor and cell mark			[exchange-point-and-mark]",
"(To clear the mark, use `[universal-argument][exchange-point-and-mark]'.)",
"",
"",
"",
"			      Navigation",
"",
"Under X, and on some terminals (those following the ANSI standard)",
"arrow keys can be used to move the cell cursor.",
"",
"up	[up-cell]		down	[down-cell]",
"right	[right-cell]		left	[left-cell]",
"",
"Though they have no default bindings, there are also the commands:",
"   upright-cell, upleft-cell, downright-cell, downleft-cell",
"",
"Some commands go to extremes but leave their mark (if none is already set):",
"",
"Upper left	[upper-left]",
"Lower right	[lower-right]",
"",
"Beginning of row	[beginning-of-row]",
"Beginning of col	[beginning-of-col]",
"End of row		[end-of-row]",
"End of col		[end-of-col]",
"",
"These commands find the boundries between filled and empty cells. They",
"are similar to word motion commands in Emacs.",
"",
"Scan up		[scan-up]",
"Scan down	[scan-down]",
"Scan right	[scan-right]",
"Scan left	[scan-left]",
"",
"",
"			  Scrolling commands",
"",
"These are used to change the visible range of a window.",
"",
"Scroll up	[scroll-up]",
"Scroll down	[scroll-down]",
"Scroll right	[scroll-right]",
"Scroll left	[scroll-left]",
"",
"These commands are also availble but not normally bound:",
"scroll-upright, scroll-upleft, scroll-downright, scroll-downleft",
"",
"",
"",
"		      Commands related to macros",
"",
"Oleo can read keystrokes, and can save keysequences in cells for later",
"re-execution.",
"  ",
"Start entering macro	[start-entering-macro]",
"Stop entering macro	[stop-entering-macro]",
"Call last kbd macro	[call-last-kbd-macro]",
"End macro		[end-macro]",
"Store last macro	[store-last-macro]",
"Run string as macro	[run-string-as-macro]",
"",
"",
"",
"			    Global options",
"",
"These are global parameters under user control (e.g. The a0/noa0",
"option that selects a syntax for cell addresses (either A1 or R1C1)).",
"",
"Show options		[show-options]",
"Set option		[set-option]",
"",
"",
"",
"			      Variables",
"",
"Variables are symbolic names for regions of a spreadsheet.  Once",
"defined, they can be used in cell formulas as region addresses.  They",
"can also be used as arguments to any command that expects a region",
"address.",
"",
"Set variable		[set-variable]",
"Show variable		[show-variable]",
"Show all variables	[show-all-variables]",
"",
"",
"",
"			    File commands",
"",
"Read a spreadsheet	[find-alternate-spreadsheet]",
"Save a spreadsheet	[save-spreadsheet]",
"Merge spreadsheet	[merge-spreadsheet]",
"Write region to file	[write-region-to-file]",
"",
"By default, if a spreadsheet defines a variable `load_hooks', the",
"macro in that region is executed when the spreadsheet is first read.",
"This behavior can be disabled or reinabled by:",
"",
"Toggle load hooks	[toggle-load-hooks]",
"",
"The next command reads a file of commands (such as a .oleorc file):",
"",
"Read commands		[read-commands]",
"",
"",
"",
"			       Printing",
"",
"Write an ascii rendition of a region			[print-region]",
"Write an embedded postscript rendition of a region	[psprint-region]",
"Set page size for postscript printing			[set-page-size]",
"",
"",
"",
"			       Plotting",
"",
"The command `[graph-setup]' accesses the Oleo interface to gnuplot.  If",
"you have gnuplot, you can draw graphs of Oleo data, either on the",
"screen, or in postscript.",
"",
"",
"		     Operations on entire regions",
"",
"Copy region		[copy-region]",
"Copy values in region	[copy-values-in-region]",
"Move region		[move-region]",
"",
"Insert row		[insert-row]",
"Insert col		[insert-col]",
"",
"Delete row		[delete-row]",
"Delete col		[delete-col]",
"",
"Delete region		[delete-region]",
"Clear spreadsheet	[clear-spreadsheet]",
"",
"",
"Window Commands ",
"",
"Recenter window			[recenter-window]",
"Open window			[open-window]",
"Split window horizontally	[split-window-horizontally]",
"Split window vertically		[split-window-vertically]",
"Delete window			[delete-window]",
"Delete other windows		[delete-other-windows]",
"Close window			[close-window]",
"Goto window			[goto-window]",
"Goto minibuffer			[goto-minibuffer]",
"Other window			[other-window]",
"",
"",
"",
"Cell attribute commands",
"",
"Set region height		[set-region-height]",
"Set region width		[set-region-width]",
"Set region protection		[set-region-protection]",
"Set region alignment		[set-region-alignment]",
"Set region format		[set-region-format]",
"Set cell height			[set-cell-height]",
"Set cell width			[set-cell-width]",
"Set cell protection		[set-cell-protection]",
"Set cell alignment		[set-cell-alignment]",
"Set cell format			[set-cell-format]",
"Set default height		[set-default-height]",
"Set default width		[set-default-width]",
"Set default protection		[set-default-protection]",
"Set default alignment		[set-default-alignment]",
"Set default format		[set-default-format]",
"Define user format		[define-user-format]",
"",
"",
"",
"			       Keymaps",
"",
"Create keymap			[create-keymap]",
"Set map prompt			[set-map-prompt]",
"Bind key			[bind-key]",
"Bind set			[bind-set]",
"Bind all keys			[bind-all-keys]",
"Write keys			[write-keys]",
"",
"",
"",
"			    Editing cells",
"",
"Edit cell			[edit-cell]",
"Set region formula		[set-region-formula]",
"",
"Delete cell			[delete-cell]",
"Delete region			[delete-region]",
"",
"Clear spreadsheet		[clear-spreadsheet]",
"",
"From the main keymap, typing almost any printable character begins ",
"to edit the value of a cell.",
"",
"These commands provide efficent motion while editing cells:",
"[[read-formula]]",
"Next edit			[next-edit]",
"Next edit-set			[next-edit-set]",
"",
"",
"These commands set the directions used by `[next-edit]' and",
"`[next-edit-set]': ",
"",
"Auto move up			[auto-move-up]",
"Auto move down			[auto-move-down]",
"Auto move left			[auto-move-left]",
"Auto move right			[auto-move-right]",
"Auto move up left		[auto-move-up-left]",
"Auto move up right		[auto-move-up-right]",
"Auto move down left		[auto-move-down-left]",
"Auto move down right		[auto-move-down-right]",
"Auto move no motion		[auto-move-no-motion]",
"",
"",
"		      Editing in the input area",
"",
"Toggle overwrite		[toggle-overwrite]",
"Beginning of line		[beginning-of-line]",
"End of line			[end-of-line]",
"Backward char			[backward-char]",
"Backward word			[backward-word]",
"Backward delete char		[backward-delete-char]",
"Backward delete word		[backward-delete-word]",
"Delete to start			[delete-to-start]",
"Forward char			[forward-char]",
"Forward word			[forward-word]",
"Delete char			[delete-char]",
"Delete word			[delete-word]",
"Kill line			[kill-line]",
"Insert cell expression		[insert-cell-expression]",
"Insert cell value		[insert-cell-value]",
"Insert rel ref			[insert-rel-ref]",
"Insert abs ref			[insert-abs-ref]",
0,
"_NON_WARRANTY_",
"",
" Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation,Inc.",
"There is ABSOLUTELY NO WARRANTY for Oleo; see the file COPYING",
"for details.  Oleo is free software and you are welcome to distribute",
"copies of it under certain conditions; see the file COPYING to see the",
"conditions.",
"",
"		The help character is ^H",
"",
"		[Press any key to begin]",
0,
0,
};


/* Search for some formula documentation. */

char **
forminfo_text (char * name)
{
  char ** pos = formula_info;
  while (*pos)
    if (!stricmp (name, *pos))
      return pos;
    else
      while (*pos++) ;
  return 0;
}