Home | Reviews | GUIpedia | Forum | Fun500
aguma | FAR OS 3Would anyone like to help me with FAR OS 3? I got a scripting language and stuff, but I haven't implemented it yet cause my dad took my laptop to China. :angry: Well, here's an example program:
WIN 50,50,300,300,"Hello World!"
#PAINT:
DRAWWIN
PRINT 20,20,"This is a test program.",15
LABEL:
GOTO LABEL
If you would like to help me, just ask.
-Andrew | 2008-07-19 | 6:03 PM |
Brandon | Re:FAR OS 3Your dad took your laptop? What do you need help with? | 2008-07-19 | 7:47 PM |
aguma | Re:FAR OS 3well, i haven't started yet! | 2008-07-19 | 8:52 PM |
aguma | Re:FAR OS 3okay, i started the scripting engine but there's a bit of a problem. Does anybody know how to get rid of all the quotes in a string? | 2008-07-21 | 5:23 PM |
Brandon | Re:FAR OS 3What? CHR(34) Is a quote. | 2008-07-21 | 5:25 PM |
aguma | Re:FAR OS 3well yeah but for some reason
FUNCTION GetLine$
DO UNTIL l$ = CHR$(255)
l$ = MID$(ProgData(CurrentProg), Programs(CurrentProg).dp, 1)
s$ = s$ + l$
Programs(CurrentProg).dp = Programs(CurrentProg).dp + 1
LOOP
s$ = LEFT$(s$, LEN(s$) - 1)
DO UNTIL NOT INSTR(s$, CHR$(34))
MID$(s$, INSTR(s$, CHR$(34)), 1) = ""
LOOP
GetLine$ = s$
END FUNCTION
doesn't work. | 2008-07-21 | 5:27 PM |
ksr | Re:FAR OS 3[b]aguma wrote:[/b]
[quote]okay, i started the scripting engine but there's a bit of a problem. Does anybody know how to get rid of all the quotes in a string?[/quote]
Is this upon input? Use 'LINE INPUT string' instead of 'INPUT string'. | 2008-07-21 | 5:29 PM |
aguma | Re:FAR OS 3Well it gets the entire program and saves into an array like this:
[Line 1] CHR$(255) [Line 2] CHR$(255)
And I get one line at a time.
If I have something like
"Hello"
it works fine, but if I have something like
PRINT "Hello"
Where the quote begins at the middle of the string, then it doesn't 'de-quote' it.
Sorry if you didn't understand that, but it's sorta hard to explain. | 2008-07-21 | 5:31 PM |
ksr | Re:FAR OS 3[b]aguma wrote:[/b]
[quote][code]MID$(s$, INSTR(s$, CHR$(34)), 1) = ""
[/code][/quote]
Is this line supposed to remove the speech marks? AFAIK you can't use MID$ like that - you would have to concatenate the part of the string on each side of the quote.
EDIT: Here is some (FreeBASIC) code that will do what I think you want to do.
[code]dim as string astring
dim as integer stringpos
astring = "Text, " + chr(34) + "more text" + chr(34) + " and even more text"
print astring
for stringpos = 1 to len(astring)
if mid(astring, stringpos, 1) = chr(34) then
'concatenate
astring = left(astring, stringpos - 1) + right(astring, len(astring) - stringpos)
end if
next
print astring
sleep [/code] | 2008-07-21 | 5:42 PM |
aguma | Re:FAR OS 3I just changed it to something like that before you said it, but thx for the code. | 2008-07-21 | 5:52 PM |
Todd | Re:FAR OS 3It's too bad QB doesn't work like PHP or C++ with quotes: "I can make "quotes" like this."
lol | 2008-07-21 | 6:16 PM |
aguma | Re:FAR OS 3wow, it's already alive and it's only been a few hours! This is the quickest working version yet!
Well, only the scripting engine as of yet. :laugh: | 2008-07-21 | 6:17 PM |
Todd | Re:FAR OS 3Progress counts. | 2008-07-21 | 6:21 PM |
aguma | Re:FAR OS 3FINALLY! After hours of struggle, I can now make a program that...
...adds two numbers. Whee.
All it can do is add.
But, as you said, progress is progress, and this is at least going somewhere, instead of being trashed. Yay! | 2008-07-21 | 6:38 PM |
Brandon | Re:FAR OS 3Don't forget the Team Cool stuff. | 2008-07-21 | 6:40 PM |
aguma | Re:FAR OS 3yeah, i'm working on a bitmap viewer.
wait...is there a bitmap viewing function? | 2008-07-21 | 6:42 PM |
Brandon | Re:FAR OS 3ok. Did you check out how to make a theme? Its easy. | 2008-07-21 | 6:44 PM |
aguma | Re:FAR OS 3i think i can figure it out. | 2008-07-21 | 6:45 PM |
GUIs
2021 Brandon Cornell