Liberty BASIC Community Forum
« callfn »

Welcome Guest. Please Login or Register.
Nov 24th, 2017, 10:53am


Rules|Home|Help|Search|Recent Posts|Notification

Problems installing Liberty BASIC? Read the Vista/Win7 Installation FAQ
Looking for a categorized List of Bug Reports? Visit the Liberty BASIC Bug Tracker

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: callfn  (Read 202 times)
Dan Teel
Guru
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1130
xx callfn
« Thread started on: Feb 21st, 2016, 4:44pm »

I was digging in the help file and saw the reserved keyword callfn. I assumed it calls a function without assigning the return value into a function

Anyways, its not documented anywhere I can find so i wrote some code to try and use it and here it is


Dont run this code unless you want to end LB with the task manager.
Code:
callfn test(1)

function test(a)
    test=a
    print a
end function
 


Liberty BASIC just keeps eating memory while trying to compile it, but if I do

Code:
callfn test()

function test()
    print "I was run!"
end function
 


It works just fine, so I guess it cant have any parameters?

Just digging.
User IP Logged

ZPtr.net
BrianM
New Member
Image


member is offline

Avatar




PM


Posts: 30
xx Re: callfn
« Reply #1 on: May 18th, 2016, 08:25am »

The parameters come after the parentheses - not inside them

e.g. callfn myfunc() p1,p2,p3 ...
User IP Logged

Dan Teel
Guru
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1130
xx Re: callfn
« Reply #2 on: May 18th, 2016, 5:26pm »

Nice. How'd you figure that out? Is it documented somewhere?
User IP Logged

ZPtr.net
Stefan Pendl
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Computers are like babies, you must teach them what you like them to do ...


Homepage PM

Gender: Male
Posts: 5297
xx Re: callfn
« Reply #3 on: May 19th, 2016, 2:58pm »

I think this is a remainder of trying to support as much Q-BASIC code as possible without conversion.
LB started out with reading Q-BASIC code without conversion initially.

I would just stick with LB syntax, if you don't convert a Q-BASIC source wink
« Last Edit: May 19th, 2016, 2:58pm by Stefan Pendl » User IP Logged

Stefan

Make sure to read and follow the Forum Guidelines

Liberty BASIC Pro 4.04, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Liberty BASIC Community Wiki
Wikispaces
Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls