Author Topic: DEF FNname (GWBASIC-style functions)  (Read 5457 times)

Clippy

  • Hero Member
  • *****
  • Posts: 16432
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #45 on: September 26, 2012, 10:47:14 PM »
Quote
_$DEFFN enabling the classic DEF FN mode... but only when needed.

WTF was I insulting?  If you want insulting then WTF would your new keyword do but break compatibility even worse.

The only thing I would like to see, IF Galleon EVER decides to add it, is that QB64 allow FN names that are NOT found after the DEF keywords. Then even if you NEVER use DEF FN, it won't bother the Hell out of everybody else!

The SIMPLEST solution right now is to just change it to a REAL FUNCTION and toss it at the end of your code. If you can't do that much work then you are lazy. No doubt about that.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Aramis

  • Newbie
  • *
  • Posts: 27
Re: DEF FNname (GWBASIC-style functions)
« Reply #46 on: October 03, 2012, 01:22:19 PM »
Clippy, I have seen very few of your posts where you are NOT insulting someone.

It gets old.

adding a _$GWBasic keyword instead, and including support for the needed compatibility modes in one fell swoop would be an extension of the same idea. It's not laziness, but accessibility.

Likewise, a _$MBasic keyword  and support would make all the old "mumblesoft basic" programs available to a new generation to learn to code.

See, the problem is, you're approach is "We don't need to cater to newbs" and then to call everyone who thinks of compatibility/accessibility lazy... but you ignore that the vast array of basic programs on the net won't compile in QB, let alone QB64.

Books on QB are not common; books using mbasic are. Many used bookstores have a dozen+.




Clippy

  • Hero Member
  • *****
  • Posts: 16432
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #47 on: October 03, 2012, 01:56:29 PM »
Just because you have a "Newbie" tag in this forum means nothing to me! You could be very experienced.

Your proposal doesn't make an sense when DEF Fn could be added seamlessly using mine.

The only reason some GW Basic keywords are supported at all is because QB 4.5 supported them.

WHO would have to ADD all of those keywords to QB64? NOT YOU! It ain't gonna fly kiddo.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Johny B.

  • Sr. Member
  • ****
  • Posts: 486
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #48 on: October 03, 2012, 06:44:19 PM »
FN functions can be supported without having a keyword to witch to some compatibility mode. Believe it or not, Clippy actually  had the right idea in his rants. We treat FN functions as they were in Qbasic, except we don't reserve the whole fn namespace for them. Problem Solved.
"Time is an illusion; Lunchtime doubly so." - Douglas Adams

SMcNeill

  • Hero Member
  • *****
  • Posts: 2414
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #49 on: October 03, 2012, 07:12:46 PM »
The problem with DEF FN and FUNCTION FN is that DEF FN generally used all the variables our main routine uses.  Functions don't.

The way to implement Fn would be to design it like a label and goto statement, with auto return.

Code: [Select]
CLS
I = 10
PRINT FNdemo(10)
END

DEF FNdemo(x)
   FNdemo = I + x
END DEF

For the above to work, DEF FNdemo(x) would have to be counted as a goto from the main program.  Then it'd have access to any other variables in the main process.  END DEF would have to return the program back to where it was called from, and return the value of FNdemo to itself to print.

So basically, behind the scene it'd need to:
See the FN call.
Find a name of FN for a match.
If no match, then FN is a variable, not a function.  (FName could be First Name, not FN ame). Do variable stuff.
Check for a return code
If code is 0, then set a return label.  Send the parameters to DEF FNname via goto.
Do the calculations.
Get to END DEF, set return code to 1.  Goto back to sending label.
At label, check return code.
If code is 1, then put value in FNname, ignore parameters.
Set code back to 0 to reset for next call.
Continue code on from that point.....
« Last Edit: October 03, 2012, 08:36:46 PM by SMcNeill »
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

Clippy

  • Hero Member
  • *****
  • Posts: 16432
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #50 on: October 03, 2012, 08:25:56 PM »
My solution is really simple. The only FN names reserved would be the ones used after DEF FN

So FName can be used unless it is used after DEF. QB did not allow ANY FNnames.

That is the main reason it has not been implemented in QB64 yet.

It may never be, if Galleon doesn't see a need for it.

QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

SMcNeill

  • Hero Member
  • *****
  • Posts: 2414
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #51 on: October 03, 2012, 10:00:26 PM »
I don't think it'd be too hard to implement.  Basically the compiler would need to do like this:

Code: [Select]
SCREEN _NEWIMAGE(1280, 720, 32)
CLS

PRINT "This is how we'd break down an DEF FN statement for use in QB64"
PRINT
PRINT "We write our code as:"
PRINT
PRINT "DEF FNAddOne(x) = x +1"
PRINT "PRINT FNAddOne(10)"
PRINT "PRINT FNAddOne(100)"
PRINT "PRINT FNAddOne(1000)"
PRINT
PRINT
PRINT "Analyzing your statement."
PRINT "From the first line I get:"
PRINT
PRINT "_FN1: 'this is our label"
PRINT "'Initilize variables'"
PRINT "FNAddOne = 0"
PRINT "x = x"
PRINT "'Done with variables, initilize formula"
PRINT "FnAddOne = x + 1"
PRINT "'Done with formula, return."
PRINT "RETURN"
PRINT "_Last_Command = 'PRINT'"
PRINT "x = 10"
PRINT "Gosub FN1"
PRINT "Command$ = _Last_Command + FNAddOne' In this case, it makes for a Command$ of PRINT 11 which the compiler then executes."
PRINT "_Last_Command = 'PRINT'"
PRINT "x = 100"
PRINT "Gosub FN1"
PRINT "Command$ = _Last_Command + FNAddOne' In this case, it makes for a Command$ of PRINT 101 which the compiler then executes."
PRINT "_Last_Command = 'PRINT'"
PRINT "x = 1000"
PRINT "Gosub FN1"
PRINT "Command$ = _Last_Command + FNAddOne' In this case, it makes for a Command$ of PRINT 1001 which the compiler then executes."

First, it looks at the DEF FN statement and breaks it apart. 
It becomes basically a GOSUB with a default label the compiler gives it.
Then it looks to see what variables are needed and initializes them.
Then it writes the formula using those variables.
Then it returns.

When you write the FN portion of the statement, it:
matches any constants to the variables above.
Checks to see what the last command is
GOSUBs to the auto-label QB64 gave it
Returns with any and all values changed that it processed.
Executes the previous statement, but substitutes the value of the FN for the FN.

It's a little work for the behind the scene compiler, but that'd be the process to do it.
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

Clippy

  • Hero Member
  • *****
  • Posts: 16432
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #52 on: October 03, 2012, 10:59:52 PM »
ERGO more work for Galleon. That's why it isn't done. There are higher priorities.

If any C coders want to take a stab at it, let us know...
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

DSMan195276

  • Hero Member
  • *****
  • Posts: 1980
  • Yes
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #53 on: October 04, 2012, 07:43:02 PM »
Quote from: Clippy on October 03, 2012, 10:59:52 PM
ERGO more work for Galleon. That's why it isn't done. There are higher priorities.

If any C coders want to take a stab at it, let us know...

Personally, I don't see why this couldn't be a higher proiority, because this is just one more thing inbetween reaching as close to 100% QBasic compatibility as possible. But of course, that's up to Galleon.

No C code should have to be changed if what SMcNeill posted works. The compiler is written in QB64 code, SMcNeill's code can be used as a sort of preprocessor to fix DEF FN functions before the code is actually compiled. It could probably be implmemented almost as is into the QB64 code right now without to many changes.

Matt
"Cast your cares on the Lord and he will sustain you; he will never let the righteous be shaken" -- Psalm 55:22
QB64 Linux Installer

Clippy

  • Hero Member
  • *****
  • Posts: 16432
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #54 on: October 04, 2012, 09:29:03 PM »
Some people did not want the FN name limitations just to implement a bygone keyword. Personally I'd probably never use it but I don't use GOTO or GOSUB much either.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

DSMan195276

  • Hero Member
  • *****
  • Posts: 1980
  • Yes
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #55 on: October 04, 2012, 09:34:08 PM »
Quote from: Clippy on October 04, 2012, 09:29:03 PM
Some people did not want the FN name limitations just to implement a bygone keyword. Personally I'd probably never use it but I don't use GOTO or GOSUB much either.

I don't see why something like what SMcNeill posted couldn't be implemented without preventing people from using FN variable names. It's not to hard to cross check a 'FN' variable name against a list of FN functions in the code and check that something is a variable and not a function. If a preprocessor type thing for FN is implemented, then it won't even be an issue. All DEF FN statements will be converted and gone before the Compiler even touches the code, and something like having a regular function that starts with FN or having a GOSUB that starts with FN has never been a problem.

Matt
"Cast your cares on the Lord and he will sustain you; he will never let the righteous be shaken" -- Psalm 55:22
QB64 Linux Installer

SMcNeill

  • Hero Member
  • *****
  • Posts: 2414
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #56 on: October 04, 2012, 10:25:20 PM »
Quote from: Clippy on October 04, 2012, 09:29:03 PM
Some people did not want the FN name limitations just to implement a bygone keyword.

The way I posted wouldn't give you any limitations for names.   A FN has to follow a DEF FN statement.   If DEF FN is used first, you set a label automatically and make a FN(name) variable.

If  a FN(name) is issued without a DEF defining it, it'd become a variable automatically.  No name restrictions imposed, except the FN you name yourself.

My DBASE project is (sorta) wrapped up at the moment.  I might try and get an actual QB64 DEF FN set of code up and going over the next few days.

Then all someone would need to do is figure out where to plug it into the QB64 source to make it work as intended.   :)
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

SMcNeill

  • Hero Member
  • *****
  • Posts: 2414
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #57 on: October 05, 2012, 12:00:37 AM »
Here's a sample of how the code would actually work, but with several limitations.

Code: [Select]
DIM var$(1000)


SCREEN _NEWIMAGE(1280, 720, 256)
COLOR 15, 127
CLS



PRINT "Give me a single line DEF FN statement, and I'll analyze it."
PRINT
INPUT UserDef$
UserDef$ = LTRIM$(RTRIM$(UCASE$(UserDef$))) + " "
PRINT: PRINT
IF LEFT$(UserDef$, 6) <> "DEF FN" THEN
    PRINT "You did not enter a correct DEF FN statment."
    PRINT
    PRINT "Now I have to laught at you, becuase I can't test what isn't a DEF FN statement, since I'm just a DEF FN simulator!"
    PRINT
    PRINT "BUWHA HA HA HA HA HA HA!"
    END
END IF
thisfar = 5
sb = INSTR(UserDef$, "(") 'startbracket
se = INSTR(UserDef$, "=") 'startequal
IF sb < se THEN
    ' FNname(variable) = something
    FNname$ = MID$(UserDef$, 5, sb - thisfar)
    thisfar = sb + 1
    vc = 1
    eb = INSTR(thisfar, UserDef$, ")") 'startbracket
    var$(vc) = MID$(UserDef$, thisfar, eb - thisfar)
    thisfar = se + 2
ELSE
    'FNname = something
    FNname$ = MID$(UserDef$, 5, se - thisfar)
    thisfar = se + 2
END IF
IF FNname$ = "FN" THEN
    PRINT "You did not give your FN a name."
    PRINT: PRINT "Now I have to laught at you, becuase you're silly!"
    PRINT: PRINT "BUWHA HA HA HA HA HA HA!"
    END
END IF
e = thisfar - 3
label$ = "Qb64_Internal_Label_" + FNname$

'We have now analyzed past the = sign.  Let's see if there's any more variables to deal with.
'I'm going to assume that each statement would have been caught by the IDE and spaced properly
'For example, DEF FNaddone(x)=x+1 should be spaced DEF FNaddone(x) = x + 1
DO
    sp = INSTR(thisfar, UserDef$, " ")
    temp$ = MID$(UserDef$, thisfar, sp - thisfar)
    vcadd = 1
    FOR i = 1 TO vc
        'check to see if we already have a variable like this one
        IF var$(i) = temp$ THEN vcadd = 0
    NEXT
    check$ = "+-/*^"
    FOR i = 1 TO LEN(check$)
        IF temp$ = MID$(check$, i, 1) THEN vcadd = 0: EXIT FOR
    NEXT
    temp1$ = LTRIM$(STR$(VAL(temp$)))
    IF VAL(temp$) = VAL(temp1$) AND temp$ = temp1$ THEN
        'it's a constant!
        vcadd = 0
    ELSE
        'it's a variable
    END IF
    IF vcadd = 1 THEN vc = vc + 1: var$(vc) = temp$
    thisfar = sp + 1
LOOP UNTIL thisfar >= LEN(UserDef$)

'Anaylze formula now
PRINT: PRINT: PRINT
formula$ = FNname$ + RIGHT$(UserDef$, LEN(UserDef$) - e + 1)


PRINT
PRINT
PRINT "GOSUB ";label$;":"
PRINT "'                                              Initilizing variables. (This part is optional since we're just defining a variable as itself."
PRINT "'                                              I just put it in here to help me watch it find the variables as needed."
PRINT
PRINT FNname$; " = "; FNname$
FOR i = 1 TO vc
    temp$ = var$(i) + " = " + var$(i)
    PRINT temp$
NEXT
PRINT
PRINT "'                                              Analyzing formula"
PRINT formula$
PRINT
PRINT "'                                                  Returning"
PRINT "RETURN"
END

At the moment, this asks you to give it a single line DEF FN statement.   (DEF FNAddOne(x) = x + 1 or something similar)
It assumes that this has already been through the IDE and has proper spacing and such.   DEF FNAddOne(x)=x+1 wouldn't work.  SPACE your code properly yourself.
It doesn't actually try to let you use the FN, though that wouldn't really be hard to add - this just shows how it'd break down the process to work, like a proof of concept illustration.
The only operations we support here is the simple math.   (+-/*^)  It'd need a full list of operators to work properly, but QB64 should have those already.  After all it already processes formula's nicely.

So, remembering the rules, give this a quick run and try it with a few single line DEF FN statements to see how it'd analyze them and break them down into code that WOULD run in QB64 even now.

It wouldn't tie up any fn names, so you could still use FName for a first name variable if you wanted to.   Only the FN(name) shown in the analyzing section would get used and added to QB64's list of variables the user has used in their program.

Since the DEF FN is analyzed, the FN would be real simple.   It'd check itself against the list of DEF FN names.  If found, it'd turn itself into a GOSUB like I illustrated would be needed above.  If it's not found in the list, then it must be a user-variable and should be treated like one.

Try it out.  See if this doesn't look like it'd translate DEF FN into a set of code that would be usable in QB64.   It makes it a GOSUB, tracks the variables, and doesn't have the limit of FUNCTION needing shared variables to pass to it.   If there's a variable in the main module, this would work with it.


Personally, I'd never use a DEF FN command I don't think, but the exercise in logic to figure out HOW to make one work is nice.  ;)

I guess the drawback to this method is that you wouldn't be able to use (Qb64_Internal_Label_" + FNname$) as a label or variable in your code anymore.  Dang it!  That breaks its usability for me....   :P
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

SMcNeill

  • Hero Member
  • *****
  • Posts: 2414
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #58 on: October 05, 2012, 01:10:39 AM »
Actually, since I couldn't sleep, here's a sort of very puny pre-compiler that would show how it'd work

Give it a DEF FN command, using the rules above.
Then give it a very simple use for that FN.

Watch it work.

(and yes, this has almost no real power or error-checking abilities)

Try it with something like:

DEF FNaddone(x) = x + 1
PRINT FNaddone(10)

or

DEF FNx3(x) = x * 3
k = k + FNx3(10)

Note:  it assumes your FN comes last, so any command after it is going to get ignored.  I'm lazy and ready to go back to bed, so I didn't worry with the rest of it.   :P
Note2:  It also assumes that you made your FN with a variable in it.  I know you don't have to, as the first half breaks it down without it, but as I said, I'm getting tired and lazy.
Use this for DEF FNname(variable) =  .......        It won't work with DEF FNname = ......

As I said before, this is just a very simple little pre-compiler type breakdown.  If anyone wants, feel free to expand upon it.  I'm certain this way would end up making a DEF FN and FN set of code that would run under QB64.  ;)


EDIT:  LOL - Toldja I was tired.  I forgot to attach the code!   

Here it is.  Give it a shot:
Code: [Select]
DIM var$(1000)


SCREEN _NEWIMAGE(1280, 720, 256)
COLOR 15, 127
CLS

PRINT "Give me a single line DEF FN statement, and I'll analyze it."
PRINT
INPUT UserDef$
UserDef$ = LTRIM$(RTRIM$(UCASE$(UserDef$))) + " "
PRINT: PRINT
IF LEFT$(UserDef$, 6) <> "DEF FN" THEN
    PRINT "You did not enter a correct DEF FN statment."
    PRINT
    PRINT "Now I have to laught at you, becuase I can't test what isn't a DEF FN statement, since I'm just a DEF FN simulator!"
    PRINT
    PRINT "BUWHA HA HA HA HA HA HA!"
    END
END IF
thisfar = 5
sb = INSTR(UserDef$, "(") 'startbracket
se = INSTR(UserDef$, "=") 'startequal
IF sb < se THEN
    ' FNname(variable) = something
    FNname$ = MID$(UserDef$, 5, sb - thisfar)
    thisfar = sb + 1
    vc = 1
    eb = INSTR(thisfar, UserDef$, ")") 'startbracket
    var$(vc) = MID$(UserDef$, thisfar, eb - thisfar)
    thisfar = se + 2
ELSE
    'FNname = something
    FNname$ = MID$(UserDef$, 5, se - thisfar)
    thisfar = se + 2
END IF
IF FNname$ = "FN" THEN
    PRINT "You did not give your FN a name."
    PRINT: PRINT "Now I have to laught at you, becuase you're silly!"
    PRINT: PRINT "BUWHA HA HA HA HA HA HA!"
    END
END IF
e = thisfar - 3
label$ = "Qb64_Internal_Label_" + FNname$ + ":"

'We have now analyzed past the = sign.  Let's see if there's any more variables to deal with.
'I'm going to assume that each statement would have been caught by the IDE and spaced properly
'For example, DEF FNaddone(x)=x+1 should be spaced DEF FNaddone(x) = x + 1
DO
    sp = INSTR(thisfar, UserDef$, " ")
    temp$ = MID$(UserDef$, thisfar, sp - thisfar)
    vcadd = 1
    FOR i = 1 TO vc
        'check to see if we already have a variable like this one
        IF var$(i) = temp$ THEN vcadd = 0
    NEXT
    check$ = "+-/*^"
    FOR i = 1 TO LEN(check$)
        IF temp$ = MID$(check$, i, 1) THEN vcadd = 0: EXIT FOR
    NEXT
    temp1$ = LTRIM$(STR$(VAL(temp$)))
    IF VAL(temp$) = VAL(temp1$) AND temp$ = temp1$ THEN
        'it's a constant!
        vcadd = 0
    ELSE
        'it's a variable
    END IF
    IF vcadd = 1 THEN vc = vc + 1: var$(vc) = temp$
    thisfar = sp + 1
LOOP UNTIL thisfar >= LEN(UserDef$)

'Anaylze formula now
PRINT
formula$ = FNname$ + RIGHT$(UserDef$, LEN(UserDef$) - e + 1)

'good so far
'Now let's get a useage

PRINT "Now give me an FN to use with it."
INPUT fnc$
PRINT: PRINT: PRINT
fnc$ = LTRIM$(RTRIM$(UCASE$(fnc$)))

sb = INSTR(fnc$, "(") + 1 'start bracket
eb = INSTR(fnc$, ")") 'end bracket

constant$ = MID$(fnc$, sb, eb - sb)

PRINT
PRINT
PRINT label$
PRINT "'                                                  Initilizing variables. (This part is optional since we're just defining a variable as itself."
PRINT "'                                                  I just put it in here to help me watch it find the variables as needed."
PRINT
PRINT FNname$; " = "; FNname$
FOR i = 1 TO vc
    temp$ = var$(i) + " = " + var$(i)
    PRINT temp$
NEXT
PRINT
PRINT "'                                                  Analyzing formula"
PRINT formula$
PRINT
PRINT "'                                                  Returning"
PRINT "RETURN"
PRINT
PRINT
PRINT "'                                                   Here's where we break down the command you gave."
PRINT var$(1); " = "; constant$
PRINT "GOSUB "; label$
PRINT LEFT$(fnc$, INSTR(fnc$, "(") - 1)

NOTE:  Since I'm too tired to even copy and paste code into a topic properly, I won't swear to this thing doing anything at the moment.  It it doesn't work using the basic examples I showed above, then someone drop me a memo and I'll see what I didn't copy/paste properly.  This SHOULD convert a DEF FN and FN statement over to a set of code that would run through QB64 even now (within the limitations of my laziness and lack of sleep at the moment).
« Last Edit: October 05, 2012, 01:51:53 AM by SMcNeill »
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

Clippy

  • Hero Member
  • *****
  • Posts: 16432
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #59 on: October 05, 2012, 07:53:11 AM »
QB64 already reserves SUB names as procedures. It could do the same thing with FNnames after DEF.

I gather you are trying to roll your own workaround. Have fun.  ;)

QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip