forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Porting scripts from W2K to XP

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
airzoom90
Newbie


Joined: 17 Dec 2004
Posts: 1

PostPosted: Fri Dec 17, 2004 10:12 am    Post subject: Porting scripts from W2K to XP Reply with quote

Hi,

I have a script that I created to run on W2K, basically all this script does is pass some commands to an application to make it do something and populate a simple text file. Now the machine I run this script on is W2K and it works fine, I have a second machine that runs XP and frustratingly my script now doesn't work. It works for one cycle but then doesn't loop as it did previously on W2K. Has anyone has simila problems or can anyone offer some advice? Script below.

Code:
Title Bloomberg
  DIALOG CREATE,New Dialog,-1,0,240,160
  dialog title,Bloomberg Capture
 
REM *** Modified by Dialog Designer on 6/6/2003 - 11:17 ***
  DIALOG ADD,BUTTON,GO,118,120,64,24,GO
  DIALOG ADD,BUTTON,STOP,118,34,64,24,===
  DIALOG ADD,TEXT,TEXT1,34,78,,,TEXT1
  DIALOG ADD,TEXT,TEXT2,61,78,,,TEXT2
  DIALOG ADD,TIME,TIME,4,140,100,24
  DIALOG ADD,TEXT,TEXT3,34,14,,,TEXT3
  DIALOG ADD,TEXT,TEXT4,60,16,,,TEXT4
  rem DIALOG ADD,MENU,MENU,&Exit
  dialog set,TEXT3,COUNTER
  dialog set,TEXT4,FILE NAME
  DIALOG SHOW
  %X = 1
  rem WARN @DATETIME(ddmmhhnnss)
  %D = @DATETIME(ddmmhhnnss)
  %A = 0
  %B = 0
  %S = 0
  %F = 0
:Evloop
  rem warn %F
  if @EQUAL(%F,0)
     wait event
     %V = @event()
     rem warn %V
     goto %V
  else
     rem wait event
    goto GOBUTTON
  end
 
 
:GOBUTTON
 
  window activate,1-BLOOMBERG
  wait 0
  rem repeat
     %A = @SUM(%A,1)
    %B = @SUM(%B,1)
     dialog set,TEXT1,%B
     wait 0
     window send,1-BLOOMBERG,NI UK BN@CR()
     rem %X = @SUM(%X,1)
     window send,1-BLOOMBERG,1@CR()
     wait 0
     window send,1-BLOOMBERG,7@CR()
     wait 0
    %D = @DATETIME(ddmmhhnnss)
     window send,1-BLOOMBERG,%D@CR()
     dialog set,TEXT2,%D
     wait 15
     rem window send,1-BLOOMBERG,@key(END)
     window send,1-BLOOMBERG,NI UK BN@CR()
    %F = 1
    rem check fthat file exists
    DIRECTORY CHANGE, n:\premium\bloomberg
    parse "%P;%Q;%R",@file(n:\premium\bloomberg\%D.txt,FTZ)
    if @null(%P)
   
    repeat
    wait 4
    %w = @sum(%w,1)
    BEEP
    until @equal(%w,9999)
    rem stop
    rem program ends if file does not exist
    end
    if @Equal(%A,25)
     runz N:\Premium\Bloomberg\work\bloombrg.cmd
     %A = 0
    End     
   
    rem wait 4
  rem UNTIL @EQUAL(%A,0)
 
   GOTO evloop
  rem info Replace this line with code to process the GOBUTTON event
  rem run winword.exe
  rem wait 5
  rem WINDOW SEND,Document1 - Microsoft Word,jdjkfgjgkljjklj
 
  rem window close, Document1 - Microsoft Word
  rem exit

:STOPBUTTON
%S = 1
exit
GOTO evloop

:EXITMENU
exit


:Close
  rem info Replace thi
  exit


Cheers.
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Dec 17, 2004 10:31 am    Post subject: Reply with quote

Hi airzoom90, welcome at VDSWORLD... Smile I think your problem lies in this loop:

Code:
    repeat
      wait 4
      %w = @sum(%w,1)
      BEEP
    until @equal(%w,9999)


It tries to do %w + 1, but there is no initial value in %w to start with. You might be able to solve it like this.

Code:
%w = 0
    repeat
      wait 4
      %w = @sum(%w,1)
      BEEP
    until @equal(%w,9999)


Please note this loop will take 9999*4 seconds before it ends!

You can also try to debug the script by hand. To do this, click the "Step through script" button, or press the F8 kotkey for this... Smile

Ps. I added the [ vds ] tags to your post, to get the code formatted like in the VDS IDE... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group