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 


Proplem with @next and timer function
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Wed Dec 03, 2003 7:04 pm    Post subject: Reply with quote

I would like to be able to use php-style comments... like '//' and '/* this is some text */' Confused

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


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

PostPosted: Wed Dec 03, 2003 7:07 pm    Post subject: Reply with quote

You won't be able to do such a thing with a DLL or DSU, because of the VDS syntax... So every command should begin at the beginning of a line, and every function must have a '@', a '(' and a ')'... Sad
_________________
[ 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
BD
Newbie


Joined: 07 Jun 2001
Posts: 10
Location: Canada

PostPosted: Wed Dec 03, 2003 8:02 pm    Post subject: Reply with quote

Hi Mark

On reviewing your code I noticed that you have a couple of file load (List loadfile) with closing the files between them. Didn't notice that before, so if you put a couple of close (list close,1) that will prob fix it. Not 100% on that, no time to test, I'm on a conference call.
Good luck

BD
Back to top
View user's profile Send private message
Mark
Newbie


Joined: 27 Nov 2003
Posts: 8

PostPosted: Thu Dec 04, 2003 11:21 am    Post subject: Reply with quote

Thanks BD It's all working now Laughing Just got to add a remove subnet button but that can wait.

Again Thank you very very much

Mark
Back to top
View user's profile Send private message
BD
Newbie


Joined: 07 Jun 2001
Posts: 10
Location: Canada

PostPosted: Fri Dec 05, 2003 2:47 am    Post subject: Reply with quote

Your welcome Mark. Glad that you got things figured out.
I had a few minutes this evening and revamped your code a bit. Hope you like it. Smile

Cheers
BD
Smile

Ok, so I guess this will be my last revamp on this code. I wasn't really crazy about adding the am pm in the text box so here's the latest and last changes. Enjoy!

Code:

rem ****************************************************************************
rem *  Program Name:
rem *  Authors Name:
rem *  Program Requirements:
rem *  Program Use:
rem *  Date created: << YYYY-MM-DD >>
rem *  Last updated: << YYYY-MM-DD >> 
rem ****************************************************************************

rem ** Variables section
gosub options
gosub List1
If @null(%A)
   gosub FIRSTRUN
End


TITLE %%AppTitle
gosub begin

:evloop
    wait event,1
    %e = @event()
   %t = @DATETIME(t)
    dialog set,status1,%f@tab()@tab()%t"    "   
   if @equal(%e,runscanBUTTON)
       repeat
           wait 5
         Gosub timer1
      until @equal(%%button,1)
       %%button = 0
   end
   Goto %e
   
rem End of script.
:cancelBUTTON
:CLOSE
  if @ask(Are you sure you want to close?)
     if @ask(Would you like to save the current Subnet.dat ranges?)
         List SAVEFILE,LIST1,@path(%0)subnets.dat
         List Close,List1
     end
     List Close,List1
     exit
  end
  goto evloop


rem ---begin gosub---
:options
   option decimalsep,"."
   option scale,96
   option fieldsep,"|"
   %P = @path(%0)
   %%AppTitle = "HfNetCHK Full EAMA Scan"
   %%AppVer = "2.00"
   %%AppBuild = "002"
   %%Copyright = "Copyright (c) 2003"
   %f = @DATETIME(yy-mm-dd)
   %y = %F %Z
   %%button = 0
   exit

:List1
   rem Load the saved Subnet list
   List Create,1
   List loadfile,1,%Psubnets.dat
   %A = @item(1)
   %%Count = @count(1)
   List Close,1
   exit

:begin
rem Dialog
  DIALOG CREATE,%%AppTitle,-1,0,553,297
  DIALOG ADD,STYLE,STYLE4,Arial,10,,WHITE,BLACK
  DIALOG ADD,STYLE,STYLE3,Arial,8,,BACKGROUND,BLACK
  DIALOG ADD,STYLE,STYLE2,Tahoma,16,I,BACKGROUND,RED
  DIALOG ADD,STYLE,STYLE1,Courier New,8,L,BLACK,DKGREEN
  DIALOG ADD,GROUP,GROUP1,4,296,254,220,Subnets that will be scanned,Style3
  DIALOG ADD,LIST,LIST1,18,304,238,198,Style1,CLICK
  DIALOG ADD,BUTTON,RUNSCAN,243,10,90,24,&Run,Style3
  DIALOG ADD,BUTTON,ADD,243,113,90,24,&Add Subnet,Style3
  DIALOG ADD,BUTTON,ABOUT,243,455,90,24,A&bout,Style3
  DIALOG ADD,TEXT,TEXT1,4,16,,,HfNetCHK Full Subnet Scan,STYLE2
  DIALOG ADD,COMBO,TIMETORUN,60,138,70,24,,CLICK,Style4
  DIALOG ADD,TEXT,TEXT2,65,13,,,Time to run daily scan:,Style3
  DIALOG ADD,GROUP,GROUP2,100,10,274,98,Advanced Options,Style3
  DIALOG ADD,TEXT,TEXT3,118,20,,,Command Line Option:,Style3
  DIALOG ADD,EDIT,CMDLINE,136,20,258,18,c:\tools\hfnetchk\hfnetchk -o tab -vv,Style4
  DIALOG ADD,TEXT,TEXT4,166,20,,,Leave off the subnet and filename switch's
  DIALOG ADD,BUTTON,REMOVE,243,216,90,24,R&emove Subnet,Style3
  DIALOG ADD,BUTTON,Cancel,243,319,90,24,&Close,Style3
  DIALOG ADD,RADIO,AP,37,233,50,46,AM/PM,AM|PM|,am
  DIALOG ADD,STATUS,STATUS1,%f,Style3
  DIALOG SHOW
  Dialog Focus,Cancel
  List CREATE,LIST1
  List LOADFILE,LIST1,@path(%0)subnets.dat
  List Create,TIMETORUN
  List Loadtext,TIMETORUN
"6:00
"6:05
"6:10
"6:15
"6:20
"6:25
"6:30
"6:35
"6:40
"6:45
"6:50
"6:55
"7:00
"7:05
"7:10
"7:15
"7:20
"7:25
"7:30
"7:35
"7:40
"7:45
"7:50
"7:55
"8:00
"8:05
"8:10
"8:15
"8:20
"8:25
"8:30
"8:35
"8:40
"8:45
"8:50
"8:55
"9:00
"9:05
"9:10
"9:15
"9:20
"9:25
"9:30
"9:35
"9:40
"9:45
"9:50
"9:55
"10:00
"10:05
"10:10
"10:15
"10:20
"10:25
"10:30
"10:35
"10:40
"10:45
"10:50
"10:55
"11:00
"11:05
"11:10
"11:15
"11:20
"11:25
"11:30
"11:35
"11:40
"11:45
"11:50
"11:55
"12:00
"1:00
"1:05
"1:10
"1:15
"1:20
"1:25
"1:30
"1:35
"1:40
"1:45
"1:50
"1:55
"2:00
"2:05
"2:10
"2:15
"2:20
"2:25
"2:30
"2:35
"2:40
"2:45
"2:50
"2:55
"3:00
"3:05
"3:10
"3:15
"3:20
"3:25
"3:30
"3:35
"3:40
"3:45
"3:50
"3:55
"4:00
"4:05
"4:10
"4:15
"4:20
"4:25
"4:30
"4:35
"4:40
"4:45
"4:50
"4:55
"5:00
"5:05
"5:10
"5:15
"5:20
"5:25
"5:30
"5:35
"5:40
"5:45
"5:50
"5:55
"6:00
  List Seek,TIMETORUN,0
  List Seek,TIMETORUN,72
  List Close,TIMETORUN
  exit

:FIRSTRUN
   REM >>Used only to create a list saved to a file for this example.<<
   List CREATE,1
   List LOADFILE,1,@path(%0)subnets.dat
   List ADD,1,"135.76.230.1-135.76.230.254"
   List ADD,1,"135.76.231.1-135.76.231.254"
   List ADD,1,"135.76.232.1-135.76.232.254"
   List ADD,1,"135.76.233.1-135.76.233.254"
   List ADD,1,"135.76.234.1-135.76.234.254"
   List ADD,1,"135.76.235.1-135.76.235.254"
   List ADD,1,"135.76.236.1-135.76.236.254"
   List SAVEFILE,1,@path(%0)subnets.dat
   List Close,1
   exit

:TIMER
   goto evloop

:Timer1
    %%time = @DLGTEXT(TIMETORUN)
   %%AMPM = @DLGTEXT(AP)
    %c = @DATETIME(t)
   %%timecom = @strins(%%time,6," ")
   %%timecom1 = @strins(%%timecom,8,%%AMPM)
    if @EQUAL(%%timecom1,%c)
      %%button = 1
      exit
    end
   exit
rem ---end gosub---

rem Begin Button and List Actions
rem About button
:AboutBUTTON
  DIALOG CREATE,About,-1,0,395,176,ONTOP
  DIALOG ADD,STYLE,STYLE1,Courier New,18,B,BACKGROUND,RED
  DIALOG ADD,BITMAP,BITMAP1,116,12,376,132,C:\Documents and Settings\mgosling\Desktop\Visual Dialog Script\HFNETSCAN\logo.bmp
  DIALOG ADD,BUTTON,OK,140,312,64,24,O&k
  DIALOG ADD,TEXT,TEXT1,8,2,,,%%AppTitle %%AppVer,STYLE1
  DIALOG ADD,TEXT,TEXT2,44,80,,,By Mark Gosling,STYLE1
  DIALOG ADD,TEXT,TEXT3,88,30,,,For Help and Support contact email address here
  DIALOG SHOWMODAL
  Dialog Close
  goto evloop   

rem Add subnet button
:addBUTTON
    %a = @INPUT(Use format x.x.x.1-x.x.x.254)
   If @null(%A)
      Info There was nothing to add!
      goto evloop
   End
   List Insert,LIST1,%A
   List SAVEFILE,LIST1,@path(%0)subnets.dat
   List Close,List1
   List Loadfile,LIST1,@path(%0)subnets.dat   
   goto evloop

rem remove a subnet button
:removeBUTTON
    %P = @index(LIST1)
    LIST Delete,LIST1,%P
   List SAVEFILE,LIST1,@path(%0)subnets.dat
   List Close,List1
   List Loadfile,LIST1,@path(%0)subnets.dat
    goto evloop

rem start button
:runscanBUTTON
    LIST LOADFILE,1,subnets.dat
   List seek,1,0
   %A = @item(1)
   %%counter = 0
   %%records = @count(1)
   Repeat
      %z = @NEXT(1)
      %%CMDLINE = @DLGTEXT(CMDLINE)
      %%fixed =  -r %z -f %y-%z.txt
      info %%CMDLINE %%FIXED
      %%counter = @succ(%%counter)
   UNTIL @equal(%%counter,%%records)   
   List Close,1
   goto evloop
   
rem Ok button from About dialog
:okBUTTON
   goto evloop
rem Click action to highlight the record to remove from the list
:LIST1CLICK
   goto evloop
rem Click action to highlight the Time from the list
:TIMETORUNCLICK
   goto evloop
rem ---end gosub---



Last edited by BD on Sat Dec 06, 2003 9:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
Mark
Newbie


Joined: 27 Nov 2003
Posts: 8

PostPosted: Fri Dec 05, 2003 11:09 am    Post subject: Reply with quote

BD you are my new god... Shocked

Thanks
Mark
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Dec 05, 2003 2:37 pm    Post subject: Reply with quote

Vic wrote:
I would like to be able to use php-style comments... like '//' and '/* this is some text */' Confused

Vic


Well Actually if you have VDS 5 you can do some of what you are asking...

Code:
#DEFINE COMMAND,/*
#DEFINE FUNCTION,/*
#DEFINE COMMAND,//
#DEFINE FUNCTION,//
/* Start your code here */

// All kinds of VDS code here
  DIALOG CREATE,Test VDS 5 Custom Comments,-1,0,599,266@//(Here is a comment after a command)
  DIALOG SHOW
:evloop
  wait event
  goto @event()@/*(Break all the rules)
goto evloop
:CLOSE
  // This is not exactly the same as a true comment/remark but at least it can be done
Exit

/* End your code here */
:/*
Exit
://
Exit


The above code will allow you to do what you want Wink

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Dec 06, 2003 2:11 am    Post subject: Reply with quote

Nice idea Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
BD
Newbie


Joined: 07 Jun 2001
Posts: 10
Location: Canada

PostPosted: Sat Dec 06, 2003 9:42 pm    Post subject: Reply with quote

Hi Mark

Had a little more time for this. Haven't any real projects on the go right now. Anyway, I made some changes to the last code that was posted. You might want to take a look, it cleans things up some and also makes things easier.
Good luck and its been fun.

Oh and by the way, I'm just a regular folk. Certainly don't need those shoes to try to fill Wink

BD
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sun Dec 07, 2003 8:37 am    Post subject: Reply with quote

good piece of lateral thinking mindpower on the use of / and // Very Happy

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 07, 2003 10:57 am    Post subject: Reply with quote

...

Not sure why ya would wanna tie up resources by declaring
functions/commands just for easier remarks... Confused

You can also use a colon ":" if "REM" is too much trouble.

Be aware that both of these methods causes VDS to compile
the remarks as labels, and can cause a slight speed decrease
because the lines will be evaluated along with other labels
for GOTO, GOSUB, etc.

Just my opinion. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Dec 07, 2003 2:05 pm    Post subject: Reply with quote

Because most cool programming languages have at least some sort of
multi-line comment system and use the standard "//" comment.

Personally the "//" and "/* & */" remarks would work best for me too. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


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

PostPosted: Sun Dec 07, 2003 3:50 pm    Post subject: Reply with quote

Maybe I've got a real cool idea... Smile What if VDS could contain some code which will be runned when you hit the compile button? That way you can add your own plugins in, like something to remove the /* and // remarks before the code is going to run. That way, you could also make it possible to to things, like adding includes automatic (I mean, that if you use @myfunction() in your code, it would automatic seek for the right dsu/dsc file)... 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
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Dec 08, 2003 1:28 pm    Post subject: Reply with quote

FreezingFire wrote:
Because most cool programming languages have at least some sort of
multi-line comment system and use the standard "//" comment.


Well... unless VDS 5 handles labels different than earlier versions,
you can only use mindpower's method ONE time in a program.
Otherwise it will always return to the first instance of the label.
And I'm guessing ya don't want to define a separate function or
command for each remark in your app...

I agree that multi-line comments are nice, and I also like the C style
"/* - */" and C++ style "//" comments. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


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

PostPosted: Mon Dec 08, 2003 3:48 pm    Post subject: Reply with quote

Mac, if you define your own commands with VDS 5, VDS will just continue from the line in which the command is called. It basicly just is a "gosub", not a "goto"... 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
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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