Qbasicnews.com
Convert Dword - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html)
+--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html)
+--- Thread: Convert Dword (/thread-6340.html)



Convert Dword - fielden - 03-06-2005

How would you convert this PowerBasic code to freebasic


Local Size as Dword
Size = MAKDWD(x, y)

Thanks for any help


Convert Dword - v3cz0r - 03-06-2005

With macros in 0.12, you can do like:

#define MAKDWD(x,y) (cint(x) shl 16 or cint(y))

dim size as uinteger ' or unsigned integer

size = MAKDWD( x, y )


Convert Dword - 1000101 - 03-06-2005

Can we do variable arguements and multi-line macros too?

Also, how is pointer math coming? ie: *(foo+bar) = something


Convert Dword - Sterling Christensen - 03-06-2005

Quote:Also, how is pointer math coming? ie: *(foo+bar) = something
From the 0.11b Changelog.txt:
Code:
[added] "*([@]variable +|- expression)" and "*@variable" support (v1c)
[added] pointer indexing support, as in "myptr[idx]" (v1c)



Convert Dword - 1000101 - 03-06-2005

That doesn't help when adding two (or more) unrelated pointers together.


Convert Dword - v3cz0r - 03-07-2005

Quote:That doesn't help when adding two (or more) unrelated pointers together.

That makes no sense. Say you have ptr1 = 100 and ptr2 = 200, both added = 300, that points to?? Neverland? :P

Try that in GCC and it will die with the "invalid operands to binary +" error.[/quote]