G.D.G. Software Forum

Support and community forum dedicated to our products:
HTML Executable - ExeOutput for PHP - Paquet Builder - GConvert - GSplit - AniTuner - CHM To Exe
It is currently Sun May 20, 2012 7:10 am

All times are UTC + 1 hour


Forum rules


All topics in this forum are read-only because they contain solutions to common problems related to HTML Executable 4. You can't post new topics in this forum directly: please use the General Discussion or Bugs/Problems forum.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
PostPosted: Wed Feb 01, 2012 2:53 pm 
Offline
User avatar

Joined: Thu Sep 15, 2011 7:51 pm
Posts: 11
Hi,

Can I take a javascript variable value to hescript. Is this possible.

Basically, I want to generate a random number in javascript and then want to transfer its value to registry. For writing to registry I am using hescript function WriteRegStr, so i want to use the value in writeregstr function.

Please give a working example.


Top
 Profile  
 
PostPosted: Thu Feb 02, 2012 12:30 am 
Offline
Technical Support
User avatar

Joined: Wed Nov 06, 2002 9:52 am
Posts: 3193
Location: www.gdgsoft.com
See http://www.htmlexe.com/help/windowexternal.htm

Use
var Value = myfunctiontogeneraterandomnumber();
window.external.SetGlobalVariable('myvar', Value, false);


Top
 Profile  
 
PostPosted: Thu Feb 02, 2012 1:24 pm 
Offline
User avatar

Joined: Thu Sep 15, 2011 7:51 pm
Posts: 11
The variable is now correctly setup.

But when I use the following hescript

procedure bms4;
var
S3: String;
begin
S3 := GetGlobalVar(rnumber1,"7777", True);
WriteRegStr(4,"SOFTWARE\BMS79","SAN5",S3);
end;

it gives me error as unknown identifier 'rnumber1'

whereas this is the name of global variable, I setup in javascript in my webpage

var rnumber=Math.floor(Math.random()*100000000)
window.external.SetGlobalVariable("rnumber1", rnumber, false);

Please advise, what is the error in hescript.


Top
 Profile  
 
PostPosted: Sat Feb 04, 2012 10:25 am 
Offline
Technical Support
User avatar

Joined: Wed Nov 06, 2002 9:52 am
Posts: 3193
Location: www.gdgsoft.com
You have made a fault, it should be:

procedure bms4;
var
S3: String;
begin
S3 := GetGlobalVar("rnumber1","7777", True);
WriteRegStr(4,"SOFTWARE\BMS79","SAN5",S3);
end;


Top
 Profile  
 
PostPosted: Mon Feb 06, 2012 10:56 am 
Offline
User avatar

Joined: Thu Sep 15, 2011 7:51 pm
Posts: 11
Thanks for the help.

One point to note, if I use True, it is not working, I have removed it and now its working perfectly.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC + 1 hour


Related topics
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Getting Hardware IDs with Javascript

iivanov2

0

331

Mon Aug 22, 2011 7:42 pm

iivanov2 View the latest post

There are no new unread posts for this topic. What exactly return GetManualHardwareID? (SOLVED)

iivanov2

4

252

Wed Sep 07, 2011 6:52 pm

iivanov2 View the latest post

There are no new unread posts for this topic. Restore from tray (SOLVED)

svenbravo7

2

215

Mon Nov 21, 2011 8:55 am

svenbravo7 View the latest post

There are no new unread posts for this topic. How to launch .avi files that sit on a DVD - SOLVED

DGross

7

236

Tue Jan 03, 2012 11:14 am

gdgsupport View the latest post

There are no new unread posts for this topic. I need autoscroll function (SOLVED)

ryosal

7

220

Wed Jan 25, 2012 6:33 pm

HawkeyeTX View the latest post

 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Copyright G.D.G. Software © 2010-2012  - Powered by phpBB® Forum Software © phpBB Group

phpBB SEO