home *** CD-ROM | disk | FTP | other *** search
- *
- * asciidec.cmd
- *
- * This command module will convert an ascii string to
- * a string of decimal numbers seperated by commas which
- * can then be used in a poke command.
- *
- * ie. if the input string is 'DIR'
- * the output string will be '68,73,82'
- *
- * To use this routine:
- * 1) put string to be converted in a memory variable
- * called "stringin"
- * 2) call this routined by using the dBASEII
- * command "DO asciidec"
- * 3) the converted string will be returned in
- * a memory variable called "stringout"
- * - Mike Kelly
- *
- * written v1.0 08-23-82
- * updated v1.0 08-23-82
- *
- *
- set echo off
- set talk off
- *
- * translate table
- * from hex 20 thru hex 7E
- *
- *
- store ' !"#$%&' +;
- chr(39) +;
- '()' +;
- '*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`' +;
- 'abcdefghijklmnopqrstuvwxyz{|}~' to asciitbl
- *
- *
- * convert ascii to decimal
- *
- *
- store stringin to param
- store 31 to base
- store ' ' to dstring
- store 0 to pointer
- *
- do while pointer<len(param)
- store $(param,pointer+1,1) to srchchar
- store @(srchchar,asciitbl) to position
- store dstring+str(position+base,3) + ',' to dstring
- store pointer + 1 to pointer
- * ? 'srchchar=',srchchar
- * ? 'position=',position
- * wait
- enddo pointer
- *
- * take off last comma
- *
- store len(dstring) to leng
- store $(dstring,1,leng-1) to dstring
- store dstring to stringout
- return