Pointers broken in 1.01 ?

Just starting out? Need help? Post your questions and find answers here.
e2robot
Posts: 38
Joined: Wed Mar 19, 2014 8:34 am

Pointers broken in 1.01 ?

Post by e2robot »

The following code works in 1.00 but doesn't in 1.01

I think it's to do with the pointer to the OnLoadFunction

Code: Select all

Global plaintext.s
Global secret.s
Global final.s

Procedure LoadScript(Script$, *OnLoadFunction)
  Debug "start load"
  !$.getScript(v_Script$,p_OnLoadFunction);
  Debug "end load"
EndProcedure

Procedure Loaded()
Debug "loaded"  
!var v_plaintext = 'Abcd';
!var v_secret    = '1234';
!var encrypted = CryptoJS.AES.encrypt(v_plaintext, v_secret);
!var decrypted = CryptoJS.AES.decrypt(encrypted, v_secret);
!v_final = decrypted.toString(CryptoJS.enc.Utf8);
Debug final
EndProcedure

LoadScript("http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js",@Loaded()); 
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: Pointers broken in 1.01 ?

Post by Fred »

Now, all the v_xxxx variable are all in lowercase as state in the doc (it was a bug in the 1.00 version), so you will need to adapt your code
e2robot
Posts: 38
Joined: Wed Mar 19, 2014 8:34 am

Re: Pointers broken in 1.01 ?

Post by e2robot »

Thanks, all working now

Phil
mave
Posts: 1
Joined: Wed May 06, 2015 5:02 pm

Re: Pointers broken in 1.01 ?

Post by mave »

Hi Fred,

tried the code with v_xxx lowercase inside SpiderBasic 1.01 (Linux - x64 -> Linux Mint 17.1-64), but nothing happens. Also all other examples here with LoadScript() doesn't work.

It seems always hanging inside !$.getScript(v_script$,p_onloadfunction);

What could this be?

Code: Select all

Global plaintext.s
Global secret.s
Global final.s

Procedure LoadScript(script$, *onloadfnction)
  Debug "start load"
  !$.getScript(v_script$,p_onloadfunction);
  Debug "end load"
EndProcedure

Procedure Loaded()
Debug "loaded" 
!var v_plaintext = 'Abcd';
!var v_secret    = '1234';
!var encrypted = CryptoJS.AES.encrypt(v_plaintext, v_secret);
!var decrypted = CryptoJS.AES.decrypt(encrypted, v_secret);
!v_final = decrypted.toString(CryptoJS.enc.Utf8);
Debug final
EndProcedure

LoadScript("http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js",@Loaded()); 
Comtois
Posts: 40
Joined: Mon Feb 24, 2014 11:07 pm

Re: Pointers broken in 1.01 ?

Post by Comtois »

Code: Select all

Procedure LoadScript(script$, *onloadfnction)
Should be

Code: Select all

Procedure LoadScript(script$, *onloadfunction)
Post Reply