Home | Reviews | GUIpedia | Forum | Fun500


BrandonNew F57 Status Image
To go with the Blog's generated one, I am making one:
http://brandoncornell.com/FUN500.PNG
2011-06-234:03 PM

DickRe:New F57 Status Image
what do the numbers mean
2011-06-248:04 PM

BrandonRe:New F57 Status Image
That's the build number, each time I add/fix something I up the number by one and post a note to my change log.
2011-06-249:10 PM

HorvatMRe:New F57 Status Image
I just had a look at build 11.

First, I was impressed that the kernel uses standard algebraic notation ('PRINT 2 + 2' executed correctly) but then I tried 'PRINT 3 + 2 * 4' and got 20. Is it going to stay that way?

Also, I noticed the kernel can apparently add/concatenate strings together. When I tried 'PRINT "abc" + "def"', I got 'abc"abc"'.

Anyway, it's a good start.

EDIT: Yes, I understand this is because it evaluates expressions from left to right.
2011-07-014:54 AM

JasonRe:New F57 Status Image
doesnt use order of operations (bodmas) it simply does the operations from left to right
2011-07-016:19 AM

BrandonRe:New F57 Status Image
Jason is right. Thanks for the tip on the string adding, I'll look into it.
2011-07-016:08 PM

JasonRe:New F57 Status Image
i'd use a different symbol for string addition, thats just me, but i use a period
2011-07-0211:29 PM

pharoahRe:New F57 Status Image
The ampersand is more BASIC style for concatenation. You can use it in FB and VB, and must use it in Gambas for that purpose. Of course, any symbol is fine.
2011-07-0211:32 PM

BrandonRe:New F57 Status Image
Thinking about it, that would make sense because then I don't think I'd need to define variables as integers or strings, it would be assumed that if your doing +-*\ that they were numbers and if you were using . or & (not sure which yet) it would be a string. Can you guys think of any reason that my scripter would need to know if a variable was a string or number other than for math?
2011-07-0312:23 AM

JasonRe:New F57 Status Image
i like the separate symbol for 'concatenation' (new word added!) that means i dont need to use str if i want to add a number to a string
shouldn't & be used for hex numbers?
2011-07-035:46 AM

HorvatMRe:New F57 Status Image
Can you guys think of any reason that my scripter would need to know if a variable was a string or number other than for math?

I'm not sure what you meant by this, but you can't use eg. string functions on numbers - unless you're going to have implicit type conversion.
2011-07-036:02 AM

pharoahRe:New F57 Status Image
My guess is that he's storing all of the values internally as strings.
2011-07-034:43 PM

HorvatMRe:New F57 Status Image
I hope not by STR$/VAL.
2011-07-034:51 PM

ToddRe:New F57 Status Image
It's too bad QB doesn't have support for pointers. I'd suggest you just create an array of pointers that refer to "DataType" structs where a DataType contains a value for the type of data stored and a pointer to the actual data (of type "Any Ptr" in FB). I think the only solution for QB is just to store everything into dynamic arrays of each data type (integer and string) and then have a global array for all variables according to their type and index in the typed-array.
2011-07-035:15 PM

DickRe:New F57 Status Image
what's wrong with str$ / val?
2011-07-035:22 PM

HorvatMRe:New F57 Status Image
They're slow and storing large numbers this way is wasteful. Plus, they may lose accuracy with floating point numbers. CVx/MKx$ are much better because QB only needs to copy memory and the strings they work with are always of the same size, which is sometimes an advantage.
2011-07-036:10 PM

pharoahRe:New F57 Status Image
Why not store them all as strings, but reserve the first character of each as a type identifier. For example, an integer cpuld be "I" + mki$(va?ue%) and a string could be "s" + value$, &c.
2011-07-041:11 AM

JasonRe:New F57 Status Image /tumbleweed
pharoah, thats what i was going to write, yeah, thats the way of going about it
2011-07-0510:48 AM

Blog


2021 Brandon Cornell