Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Any Data Type?
#1
I was wondering will the Any data type ever work by itself (without Ptr usage). I would be pretty cool but not nessicary.
Reply
#2
It does.

Code:
DECLARE SUB foo (whatsThis AS ANY)
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
It only works for libraries. I guess that's all we'll need it for. It doesn't work as a function return type however.
Reply
#4
AS ANY can only be used with prototypes and if the argument is declared as BYREF.

It's there just for QB compatibility, as the QB IDE used to create the prototypes for you automagically, using AS ANY when it couldn't guess the type for some reason.
Reply
#5
Yup, it was used in DECLAREs when you hadn't defined your types yet in the code.

In fB I prefer doing it "the proper way", i.e. defining my types before adding the declares. I find it cleaner and less error-prone.

Code:
TYPE DotType
   x AS INTEGER
   y AS INTEGER
END TYPE

DECLARE SUB whatsThis (dot AS DotType, p AS INTEGER)
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)