Statistics: Posted by moneo — Fri Dec 08, 2006 8:36 pm
You can add any valid ASCII characters you want, either directly to a PRINT command or to a string, like:.....More on my program...
So how can I add non printable Characters in a Print statement? Specifically an ASCii Value of 001
Statistics: Posted by Mike Alexander — Fri Dec 08, 2006 4:17 pm
Statistics: Posted by moneo — Thu Dec 07, 2006 7:55 pm
Code:
c$ = command$ 'get the command-line, except for the .EXE name.s = instr(c$," ") 'find location of space delimiter between filenames.if s = 0 then print "Invalid or missing filenames" : systemfilold$ = left$(c$,s-1) 'Get leftmost filename.filold$ = ltrim$(rtrim$(filold$)) 'Get rid of any leading or trailing spaces.filnew$ = mid$(c$,s+1) 'Get leftmost filename.filnew$ = ltrim$(rtrim$(filnew$))
Statistics: Posted by Mike Alexander — Wed Dec 06, 2006 10:25 pm
Code:
DECLARE SUB aMain ()DECLARE FUNCTION StatusFile% (f AS STRING)DIM SHARED MyErr AS INTEGERCALL aMainSYSTEMGetMyErr: MyErr = ERR: RESUME NEXT REM NOTE....SUB aMainCLS : LOCATE 2, 20: PRINT "Testing function StatusFile": PRINTPRINT "Enter file names to be tested. Just press Enter when finished."DO PRINT LINE INPUT "fname: "; f$ IF f$ = "" THEN EXIT DO SELECT CASE StatusFile(f$) CASE 0: PRINT "Bad File Name" CASE 1: PRINT "Exists" CASE 2: PRINT "Does not exist" END SELECTLOOPSYSTEMEND SUBFUNCTION StatusFile% (f AS STRING)IF LEN(f) = 0 THEN EXIT FUNCTION' Ensure no spaces anywhereIF INSTR(t$, " ") > 0 THEN EXIT FUNCTION' Separate file name from path, if anyDIM y AS INTEGERFOR y = LEN(f) TO 1 STEP -1 SELECT CASE MID$(f, y, 1) CASE "", "/", ":": EXIT FOR CASE " ": EXIT FUNCTION END SELECTNEXT yIF y = 1 THEN t$ = f ELSE t$ = RIGHT$(f, LEN(f) - y)' Test for prefix(8 max).suffix(3 max)FOR y = LEN(t$) TO 1 STEP -1 IF MID$(t$, y, 1) = "." THEN IF LEN(t$) - y > 3 THEN EXIT FUNCTION' suffix>3 IF y = 1 THEN EXIT FUNCTION ' name was just "." t$ = LEFT$(t$, y - 1): EXIT FOR END IFNEXT yIF LEN(t$) > 8 THEN EXIT FUNCTION' OK, now test whole thing for reaMaining errorsMyErr = 0: ON ERROR GOTO GetMyErr REM NOTE....OPEN f FOR INPUT AS #1: CLOSEON ERROR GOTO 0 REM NOTE...IF MyErr = 0 THEN StatusFile% = 1 REM NOTE....IF MyErr = 53 THEN StatusFile% = 2 REM NOTE....END FUNCTION
Statistics: Posted by moneo — Sun Dec 03, 2006 5:46 pm
Statistics: Posted by Mike Alexander — Sat Dec 02, 2006 11:55 pm
Statistics: Posted by moneo — Sat Dec 02, 2006 4:05 pm
Statistics: Posted by Mike Alexander — Fri Dec 01, 2006 10:44 pm
Statistics: Posted by Mike Alexander — Fri Dec 01, 2006 10:20 pm
Code:
c$ = command$ 'get the command-line, except for the .EXE name.s = instr(c$," ") 'find location of space delimiter between filenames.if s = 0 then print "Invalid or missing filenames" : systemfilold$ = left$(c$,s-1) 'Get leftmost filename.filold$ = ltrim$(rtrim$(filold$)) 'Get rid of any leading or trailing spaces.filnew$ = mid$(c$,s+1) 'Get leftmost filename.filnew$ = ltrim$(rtrim$(filnew$))
Statistics: Posted by moneo — Fri Dec 01, 2006 9:30 pm
Statistics: Posted by Mike Alexander — Fri Dec 01, 2006 8:33 pm