-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed bugs and changed syntax * Added input command
- Loading branch information
Showing
2 changed files
with
88 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
function replace (byval original as string, oldstr as string, newstr as string) as string | ||
dim as integer position=1 | ||
while true | ||
dim as integer location=instr(position,original,oldstr) | ||
if location>0 then | ||
original=mid(original,1,location-1)+newstr+mid(original,location+len(oldstr)) | ||
position=location | ||
else | ||
exit while | ||
end if | ||
wend | ||
return original | ||
end function | ||
|
||
function checkIfValid (nam as string) as integer | ||
if nam="if" or nam="goto" or nam="print" or nam="true" or nam="false" or nam="input" then | ||
return false | ||
end if | ||
for i as integer=1 to len(nam) | ||
dim as integer char=asc(mid(nam,i,1)) | ||
if not (char>=asc("A") and char<=asc("Z")) and not (char>=asc("a") and char<=asc("z")) and not (char>=asc("0") and char<=asc("9")) and not mid(nam,i,1)="_" then | ||
return false | ||
end if | ||
next | ||
return true | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters