Page 1 of 1

Pointers broken in 1.01 ?

Posted: Tue Apr 14, 2015 12:09 am
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()); 

Re: Pointers broken in 1.01 ?

Posted: Wed Apr 15, 2015 6:54 am
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

Re: Pointers broken in 1.01 ?

Posted: Wed Apr 15, 2015 10:38 pm
by e2robot
Thanks, all working now

Phil

Re: Pointers broken in 1.01 ?

Posted: Wed May 06, 2015 5:51 pm
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()); 

Re: Pointers broken in 1.01 ?

Posted: Wed May 06, 2015 7:39 pm
by Comtois

Code: Select all

Procedure LoadScript(script$, *onloadfnction)
Should be

Code: Select all

Procedure LoadScript(script$, *onloadfunction)