Newton Does It!
03.10.2003 |
QuickFigure Works/Pro
|
Function/Example | Description/Result |
---|---|
Capitalize | capitalizes the first letter of a string |
Capitalize("hello world") | Hello world |
CapitalizeWords | capitalizes the first letter of each word |
CapitalizeWords("hello word") | "Hello World" |
UpCase | capitalizes whole string |
UpCase("hello world") | "HELLO WORLD" |
DownCase | converts whole string to lower case |
DownCase("HELLO WORLD") | "hello world" |
StringToNumber | converts a string to a number (for calculations) |
StringToNumber("0815") | 815 |
NumberStr | converts a number to a string |
NumberStr(800+15) | "815" |
StrLen | length of string |
StrLen("Hello World") | 11 |
BeginsWith | compares the beginning of two strings |
BeginsWith("Hello World","Hel") | True (boolean value for IF ... THEN ... ELSE) |
EndWith | compares the end of two strings |
EndWith("Hello World","ord") | False (boolean value for IF ... THEN ... ELSE) |
& | joins two strings |
"Hello" & "World" | "HelloWorld" |
&& | joins to strings with one space |
"Hello"&&"World" | "Hello World" |
SubStr | extracts a part of a string (string,start,count) |
SubStr("Hello World",2,3) | "llo" |
StrPos | finds a string in an other (string,substring,start) |
StrPos("Hello World","or", 0) | 7 |
Chr | displays the ASCII character with this code |
Chr(78) | "N" |
Cell A1 : Enter your name: Cell A2 : Cell A3 : =IF STRLEN(A2 & "") = 0 THEN "Cell A2 is emtpy" ELSE "The name is " & A2
Cell A1 : account Cell A2 : 500 Cell A3 : = IF A2 <= 0 THEN PLAYSOUND("Sorry, no money left!") ELSE PLAYSOUND(NumberStr(A2))
If you put zero or a negative number in A2 QF Works/Pro will warn you about your financial situation :-)
for Poker : =buildContext(@830):open() or for Patience : =buildContext(@831):open()
Cell A1 : = GetUserConfig('name)
But there is no way to retrieve second level data, like the GMT offset.
Don Vollum from PelicanWare has confirmed this "feature" and will try to fix it in the next version of QF Pro (if there will be any).
QuickFigure also has some problems with nested function calls. When I tried to analyze the server log of my web site I noticed the following problem: :
The cells A1 to A50 contain the handled file requests sorted by the number of requests. The format is "number of requests : transferred kb : file name".
Cell A1 : 123 : 34 : <index.html>
Cell A2 : 143 : 45 : <something.html>
etc.
To sort this list alphabetically column A must be separated in requests, transferred KB and file name.
Separating the file name in three steps :
Cell B1 : "= StrPos(a1,"<",0)" Cell C1 : "= StrPos(a1,">",0")" Cell D1 : "= SubStr(a1,b1+1,c1-b1-1)"
But trying to combine all three steps in just one cell
cell B1 : "= SubStr(a1,StrPos(a1,"<",0)+1, StrPos(a1,">",0")-StrPos(a1,"<",0)-1)"
This is probably old news, but I've been getting some Y2K bug reports on some of my software, and lo and behold, stringToDate has what I would describe as a bug (I'm sure if Newton DTS were still around, they would explain to me how this is a feature, it's supposed to be this way, whatever...).
Anyway, here goes:
stringToDate("7/21/99")
#1885A334 102852813
stringToDate("7/21/1999")
#BFB6EB4 50256813
stringToDate("7/21/2099")
#1885A340 102852816
Essentially, it's interpreting any date in mm/dd/yy format as "20yy".
More information about the Y2K bug can be found at : PelicanWare Y2K
Andree Dettmer 03.10.2003