Use of the Null() function, also FPU requirements

Moderators: Der Wanderer, Blackbird

Use of the Null() function, also FPU requirements

Postby Daedalus » 18. February 2015, 01:13

Hi all,
I've recently updated AmiBlitz3 to the latest version on Sourceforge (3.6.1). Since I updated I haven't been able to use the Null() function - the compiler gives me a garbage / unwanted characters at end of line error. Is there a simple alternative for this or is it just a case of assigning a string and using the address from this? So

MUISet obj,property,Null("MyTitle "+myvar$)

is now

mydummy$="MyTitle "+myvar$
MUISet obj,property,&myvar$

Also, with the note that was included in the archive I understand that an FPU is a requirement. I know certain commands used the FPU but I was able to build executables with AmiBlitz 3.5 that run fine without an FPU by just avoiding particular commands that caused crashes without an FPU (such as val()). Has this changed, or are my 3.5 executables possibly faulty too even though there's no sign of any crashes?

Thanks!
User avatar
Daedalus
Newbie
 
Posts: 41
Joined: 12. May 2014, 23:11
Location: Glasgow, Scotland

Re: Use of the Null() function, also FPU requirements

Postby Blackbird » 18. February 2015, 10:39

Yes we are changed this, use Str2Adr instead
User avatar
Blackbird
Globaler Moderator
 
Posts: 666
Joined: 9. October 2013, 17:41
Location: Coburg

Re: Use of the Null() function, also FPU requirements

Postby tomsmart1 » 18. February 2015, 14:45

We changed the orginal NULL() to Str2Adr() in Revision R487 http://sourceforge.net/p/amiblitz3/code/487/log/ to make the command (function) usable again because the Compiler use NULL for 0. To use it you need the compiler and Deflibs form R487 or newer and a rebuild of the Instuction index ( over the PEd menupoint Help=>Instruction index rebuild). If the Source you used was saved in tokenized form with .bb or .bb2 ending then the Source use automaticly the new name Str2Adr(). If it was save in text form with the ending .ab2 or .ab3 you have to convert it manualy by replaceing "NULL(" with "Str2Adr(".


The problem with the FPU use is bigger then some commands like Val() it is use for Function Returnvalues to and more. I can't 100% say with command are effected because it is not clear for me the way i can read the compiler sourcecode.
tomsmart1
Master
 
Posts: 289
Joined: 10. October 2013, 19:15

Re: Use of the Null() function, also FPU requirements

Postby Daedalus » 21. February 2015, 14:34

That's great, thanks for the information. Str2Adr will work fine, slightly easier to search and replace that in my sources :)

As for the FPU thing, I understand that at least it hasn't changed since 2.4, so I'll put a warning in my readmes about it. But code that has worked for years without an FPU should still work with the latest compiler I take it.

Thanks again!
User avatar
Daedalus
Newbie
 
Posts: 41
Joined: 12. May 2014, 23:11
Location: Glasgow, Scotland

Re: Use of the Null() function, also FPU requirements

Postby Daedalus » 19. May 2015, 00:07

Sorry to bring this up again. At the time of that post I thought I tried Str2Adr() but now Str2Adr is not recognised by AmiBlitz, nor is StrToAdr. I haven't updated or changed anything, but just to check in case something was wrong with my setup, I downloaded AmiBlitz 3.6.1 from Sourceforge and tried that. It doesn't recognise Str2Adr or StrToAdr either. A text search of all files doesn't find it either.

Am I going crazy here? Did I miss something? I think I have the updated versions of the libraries because the fresh 3.6.1 did not work, and the Null() function doesn't work like it did in older versions.

Thanks!
User avatar
Daedalus
Newbie
 
Posts: 41
Joined: 12. May 2014, 23:11
Location: Glasgow, Scotland

Re: Use of the Null() function, also FPU requirements

Postby Der Wanderer » 19. May 2015, 19:47

=> Time for Distro Update...
User avatar
Der Wanderer
Globaler Moderator
 
Posts: 396
Joined: 3. September 2013, 10:26

Re: Use of the Null() function, also FPU requirements

Postby Daedalus » 20. May 2015, 22:25

Ah, I see what's wrong so. I downloaded the changed files in the ElmoreSysLib update, rebuilt the instruction index and it's working. Thanks for the hint :)
User avatar
Daedalus
Newbie
 
Posts: 41
Joined: 12. May 2014, 23:11
Location: Glasgow, Scotland

Re: Use of the Null() function, also FPU requirements

Postby tomsmart1 » 28. May 2015, 14:41

Sorry Deadalus i can't answer you befor, the dispor 3.6.1 are old and the change of NULL => Str2Adr are not in there. Best is you use always the latest checkout of the SVN to have all the latest changes.
tomsmart1
Master
 
Posts: 289
Joined: 10. October 2013, 19:15

Re: Use of the Null() function, also FPU requirements

Postby tomsmart1 » 31. May 2015, 16:25

I updated the ElmoreSysLib and also the DefLibs to fix the Longread to $14 by this i renamed the function 'StrToAdr' to the better name 'GetGlobalStrAddr' that was suggested by 'Der Wanderer'.

Also Bernd write in a other post that this function is not needed with Blitzbasic 2 and newer because it use always null-terminated strings so you can use '&' instead for example 'x=&String$'.
tomsmart1
Master
 
Posts: 289
Joined: 10. October 2013, 19:15

Re: Use of the Null() function, also FPU requirements

Postby Daedalus » 1. June 2015, 11:53

tomsmart1 wrote:Also Bernd write in a other post that this function is not needed with Blitzbasic 2 and newer because it use always null-terminated strings so you can use '&' instead for example 'x=&String$'.


That's true, and I had worked around it using that method before, but I was using the old Null() function as a tidy method of combining strings as a parameter. 'x=&String1$+String2$' doesn't work for example, so you need x$=String1$+String2$:x=&x$ instead.

Thanks for your work on this!
User avatar
Daedalus
Newbie
 
Posts: 41
Joined: 12. May 2014, 23:11
Location: Glasgow, Scotland


Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 1 guest

cron