home *** CD-ROM | disk | FTP | other *** search
EPOC OPL Source | 2001-10-05 | 1.7 KB | 71 lines |
-
-
- Rem EXTENSIONS for FORMULARY, vwa240901
- Rem The following functions are more or less for demo purpose only.
- Rem Compile and "Menu\LoadOPL"
- Rem and call them from within FORMULARY with their name and parameters.
- Rem Only procedure names with letters allowed (not "Add10:"!).
- rem -------------------------------------------------------------
-
- rem ASCII:(start_ch)
- rem show character table with Hex and decimal codes
- rem start_ch is the first of 128 characters
- rem e.g. "ASCII:(0)" or "ASCII:(128)"
-
- rem AddTen:(a)
- rem Demonstration of number function with number parameter
-
- rem StringLength&:(str$)
- rem Demonstration of number function with string parameter
-
- rem AddToStr$:(str$)
- rem Demonstration of string function with string parameter
-
- rem -------------------------------------------------------------
-
- PROC AddTen:(a)
- return a+10
- ENDP
-
- proc StringLength&:(str$)
- return len(str$)
- endp
-
- proc AddToStr$:(str$)
- return str$+" was a test"
- endp
-
- proc Ascii:(a)
- local asciiW%,n%,i%
- asciiW%=gCREATE(10,10,screenW%-20,screenH%-20,1)
- gBorder 3
- gFont 268436066
- n%=0
- do
- i%=n%+a
- gAt (n%/16)*77-5,(n%-(n%/16)*16)*13+14
- gPrint "| "
- gStyle 1
- gPrint Ascii$:(i%)
- gStyle 0
- gPrint " ";hex$(i%),i%,
- n%=n%+1
- until n%>127
- get
- gClose asciiW%
- endp
-
- proc Ascii$:(n%)
- if n%<32
- return Mid$("NULSOHSTXETXEOTENQACKBEL BS HT LF VT FF CR SO SIDLEDC1DC2DC3DC4NAKSYNETBCAN EMSUBESC FS GS RS US",n%*3+1,3)
- elseif n%=127
- return " "
- else
- return chr$(n%)
- endif
- endp
-
-
-
-
-