home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 1117 / Formulary.sis / Extension.opl (.txt) next >
Encoding:
EPOC OPL Source  |  2001-10-05  |  1.7 KB  |  71 lines

  1.  
  2.  
  3. Rem EXTENSIONS for FORMULARY, vwa240901
  4. Rem The following functions are more or less for demo purpose only.
  5. Rem Compile and "Menu\LoadOPL"
  6. Rem and call them from within FORMULARY with their name and parameters.
  7. Rem Only procedure names with letters allowed (not "Add10:"!).
  8. rem -------------------------------------------------------------
  9.  
  10. rem ASCII:(start_ch)
  11. rem show character table with Hex and decimal codes
  12. rem start_ch is the first of 128 characters
  13. rem e.g. "ASCII:(0)" or "ASCII:(128)"
  14.  
  15. rem AddTen:(a)
  16. rem Demonstration of number function with number parameter
  17.  
  18. rem StringLength&:(str$)
  19. rem Demonstration of number function with string parameter
  20.  
  21. rem AddToStr$:(str$)
  22. rem Demonstration of string function with string parameter
  23.  
  24. rem -------------------------------------------------------------
  25.  
  26. PROC AddTen:(a)
  27.     return a+10
  28. ENDP
  29.  
  30. proc StringLength&:(str$)
  31.     return len(str$)
  32. endp
  33.  
  34. proc AddToStr$:(str$)
  35.     return str$+" was a test"
  36. endp
  37.  
  38. proc Ascii:(a)
  39.     local asciiW%,n%,i%
  40.     asciiW%=gCREATE(10,10,screenW%-20,screenH%-20,1)
  41.     gBorder 3
  42.     gFont 268436066
  43.     n%=0
  44.     do
  45.         i%=n%+a
  46.         gAt (n%/16)*77-5,(n%-(n%/16)*16)*13+14
  47.         gPrint "| "
  48.         gStyle 1
  49.         gPrint Ascii$:(i%)
  50.         gStyle 0
  51.         gPrint " ";hex$(i%),i%,
  52.         n%=n%+1
  53.     until n%>127
  54.     get
  55.     gClose asciiW%
  56. endp
  57.  
  58. proc Ascii$:(n%)
  59.     if n%<32
  60.         return Mid$("NULSOHSTXETXEOTENQACKBEL BS HT LF VT FF CR SO SIDLEDC1DC2DC3DC4NAKSYNETBCAN EMSUBESC┬áFS GS RS US",n%*3+1,3)    
  61.     elseif n%=127
  62.         return " "
  63.     else
  64.         return chr$(n%)
  65.     endif
  66. endp
  67.  
  68.  
  69.  
  70.  
  71.