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 


VDS 5 Sampler

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sun Oct 16, 2005 5:47 pm    Post subject: VDS 5 Sampler Reply with quote

Update 2a (Added save mode)

I have put this script together for help on some advanced stuff in VDS
Some tips and tricks...

Code:
#Begin Program Name
  if @WINEXISTS(#Program Name)
    WINDOW ACTIVATE,@WINEXISTS(#Program Name)
    exit
  end

  OPTION DECIMALSEP,"."
  OPTION ERRORTRAP,Error name
  OPTION SCALE,96

  %W = @WINDIR(W)
  %S = @WINDIR(S)

  Title Program Name

  DIALOG CREATE, Program Name,-1,0,440,440,SAVEPOS,Color White,CLASS Program Name
  DIALOG ADD,MENU,&Menu options,Save list,MS Paint|F5,-,Child dialog,ASCII decoder,-,&Exit|ALT+X
  DIALOG ADD,PROGRESS,PROGRESS1,380,20,180,20,20,,
  DIALOG ADD,STYLE,STYLE1,Tahoma,8,U,,black
  DIALOG ADD,GRADIENT,GRADIENT1,0,0,350,30,white,$00C16100,,righttoleft
  DIALOG ADD,BITMAP,BITMAP1,85,20,48,48,%W\Blue Lace 16.bmp,This is bitmap with click.,CLICK
  DIALOG ADD,BITMAP,BITMAP2,95,180,32,32,%S\url.dll,Popup event,CLICK,HAND
  DIALOG ADD,GROUP,GROUP1,150,20,180,40,GROUP name
  DIALOG ADD,PROGRESS,PROGRESS2,380,20,180,20,40,,
  DIALOG ADD,LINE,LINE1,70,20,400,1
  DIALOG ADD,SHAPE,SHAPE1,85,99,49,49,RED,$00C16100,This is SHAPE element with click.@CR()You can use it with RECTANGLE"," SQUARE"," ROUNDRECT","@CR()ROUNDSQUARE and ELLIPSE.,ELLIPSE,CLICK
  DIALOG ADD,TEXT,TEXT1,43,20,,,Text line"," with click,Tooltip test and you can click on it.,CLICK,HAND,TRANSPARENT,STYLE1
  DIALOG ADD,TEXT,T2,165,28,,,List drop text,,,,TRANSPARENT
  DIALOG ADD,TIME,TIME1,3,343,90,24,This is clock and you can click on it.,CLICK
  DIALOG ADD,BUTTON,BUTTON1,85,250,160,48,Close && Exit
  DIALOG ADD,PROGRESS,PROGRESS3,380,20,180,20,60,,
  DIALOG ADD,BUTTON,Run,3,195,58,24,
  DIALOG ADD,LIST,LIST1,200,20,180,90,,,CLICK
  DIALOG ADD,EDIT,EDIT1,5,6,180,19,
  DIALOG ADD,PROGRESS,PROGRESS4,380,20,180,20,80,,
  DIALOG ADD,COMBO,COMBO1,45,135,95,21,Combo Item1,Chose your shutdown option...,LIST,CLICK
  gosub fillcombo1
  DIALOG ADD,SPIN,SPIN1,45,250,45,24,0|99,0,,CLICK
  DIALOG ADD,TAB,TAB1,150,210,220,140,Lisa|Bart|Homer
  DIALOG ADD,TABLE,TABLE1,293,210,220,124,Bart[80]|Lisa[80]|Homer[80],Table 1 Tooltip,COLUMNSORT
  DIALOG ADD,RADIO,RADIO1,300,20,80,72,Radio station,Radio HIT|Val 202|Zeleni val,Radio HIT,,CLICK
  DIALOG ADD,CHECK,CHECK1,310,110,80,19,95","6 MHz,,,CLICK
  DIALOG ADD,CHECK,CHECK2,330,110,80,19,96","90 MHz,,,CLICK
  DIALOG ADD,CHECK,CHECK3,350,110,80,19,97","0 MHz,,,CLICK
  DIALOG ADD,STATUS,STATUSname,VDS 5 sampler@TAB()@TAB()Free mem: @format(@fdiv(@SYSINFO(FREEMEM),1024),0.2) MB

  LIST loadtext,list1
"Putting the text in second line
"Isolating Characters
"Special Characters
"Desktop resolution
"System power-up
"Wasabi?

  rem LIST loadtext,TABLE1
  rem "Bart
  rem "Lisa
  rem "Homer

  DIALOG SHOW

  LIST ADD,LIST1,Save LIST1 to txt file
 
  list add,table1,hello@tab()hi@tab()hey
  list add,table1,hi@tab()hey@tab()hello
  list add,table1,hey@tab()hello@tab()hi

  Info Welcome to VDS 5 Sampler with practical use of commands.@CR()@CR()This include:@CR()@CR()TAB system@CR()Child dialog system@CR()Adding "&" on button@CR()Coma problem in text@CR()ASCII code creator@CR()Converting KB to MB and GB@CR()Saving information from LIST to text file@CR()and more...
  DIALOG ADD,PROGRESS,PROGRESS5,380,20,180,20,100,,

  if @not(%1)
    %1 = Lisa
    gosub %1OPEN
  end

  DIALOG HIDE,PROGRESS1
  DIALOG HIDE,PROGRESS2
  DIALOG HIDE,PROGRESS3
  DIALOG HIDE,PROGRESS4
  DIALOG HIDE,PROGRESS5

:loop
  wait event,0.1
  parse "%E;%D",@event(D)
  goto %E

:LisaCLICK
:BartCLICK
:HomerCLICK
  %2 = @substr(%E,1,-5)
  gosub %1CLOSE
  shift
  gosub %1OPEN
  goto loop

:LisaOPEN
  DIALOG ADD,GROUP,GROUP2,180,220,160,100,Lisa
  exit

:BartOPEN
  DIALOG ADD,GROUP,GROUP3,180,220,160,100,Bart
  exit

:HomerOPEN
  DIALOG ADD,GROUP,GROUP4,180,220,160,100,Homer
  exit

:LisaCLOSE
  Dialog remove,GROUP2
  exit

:BartCLOSE
  Dialog remove,GROUP3
  exit

:HomerCLOSE
  Dialog remove,GROUP4
  exit

:Timer
  goto loop

:fillcombo1
  %%Comboitem = @dlgtext(Combo1)
  list loadtext,combo1,
"Combo Item 1
"Combo Item 2
"Combo Item 3
"Combo Item 4
"Combo Item 5
"Combo Item 6
  LIST SEEK, COMBO1, 0
  exit

:Combo1CLICK
  %%Comboitem = @item(COMBO1)

  if @equal(%%Comboitem,Combo Item 1)
    info Combo Item = 1
  end

  if @equal(%%Comboitem,Combo Item 2)
    info Combo Item = 2
  end

  if @equal(%%Comboitem,Combo Item 3)
    info Combo Item = 3
  end

  if @equal(%%Comboitem,Combo Item 4)
    info Combo Item = 4
  end

  if @equal(%%Comboitem,Combo Item 5)
    info Combo Item = 5
  end

  if @equal(%%Comboitem,Combo Item 6)
    warn Combo Item = 6
  end
  goto loop

:SPIN1CLICK
  %h = @dlgtext(spin1)
  info Spin value = %h
  goto loop

:LIST1CLICK
  %I = @ITEM(LIST1)
  goto %I
  goto loop

:Desktop resolution
  %X =  @SYSINFO(SCREENWIDTH) x @SYSINFO(SCREENHEIGHT) at @SYSINFO(PIXPERIN) DPI
  parse T2,%X
  goto loop

:System power-up
  %X = System power-up @SYSINFO(WINBOOT)
  parse T2,%X
  goto loop

:Special Characters
  %X =  Use from menu ASCII decoder
  parse T2,%X
  goto loop

:Putting the text in second line
  %X = Do with this "@CR()"
  parse T2,%X
  goto loop

:Isolating Characters
  %X = Shift + 2 add this like this @CHR(34)","@CHR(34)  @CHR(34)"@"@CHR(34)
  parse T2,%X
  goto loop

:Wasabi?
  %X = Wasabi is Japanese horseradish.
  parse T2,%X
  goto loop
 
:Save LIST1 to txt file
:Save LISTMENU
   %%UN = @regread(HCU,Software\Microsoft\Windows\CurrentVersion\Explorer,Logon User Name)
   %f = @filedlg("Text File (*.txt)|*.txt",Save as,%%UN,Save)
    if @null(%f)
    goto loop
    else
    goto Save1
    end
 
  :Save1
     %F = @path(%F)@name(%F).txt
     if @file(%f)
     goto save2
     else
     LIST SAVEFILE,list1,%f
     wait
     end
     goto loop
 
  :Save2
  %F = @path(%F)@name(%F).TXT
  if @file(%f)
    %R = @MSGBOX(@PATH(%f)@NAME(%f)"."txt already exists.@CR()Do you want to replace it?,Sava As,$031)
    if @equal(%R,1)
      LIST SAVEFILE,list1,%f
      wait 1
    else
      goto loop
    end
  end
  goto loop

:BUTTON1BUTTON
  goto close

:BITMAP1CLICK
  goto text1click

:BITMAP2CLICK
  DIALOG POPUP,Popup Event|-|Hide popup|-|Beep|-|CD eject|CD shut
  goto loop

:RADIO1CLICK
  info This is Radio Hit event
  dialog set,Check1,1
  goto evloop

:RADIO2CLICK
  info This is Val 202 event
  dialog set,Check2,1
  goto evloop

:RADIO3CLICK
  info This is Zeleni val event
  dialog set,Check3,1
  goto evloop

:CHECK1CLICK
  info This is Check 1 event
  goto loop

:CHECK2CLICK
  info This is Check 2 event
  goto loop

:CHECK3CLICK
  info This is Check 3 event
  goto loop

  rem ----------------------Begin Child dialog program

:Child DialogMENU
  title Secondary program
  DIALOG CREATE,Secondary program ,-1,0,300,240,NOMIN
  DIALOG ADD,BUTTON,BUTTONok,186,214,64,24,OK
  DIALOG ADD,SHAPE,SHAPE1,10,10,130,40,$00EFDFFF,silver,,,ROUNDRECT
  DIALOG ADD,TIME,TIME2,18,30,90,24,This is clock and you can click on it.,CLICK
  DIALOG ADD,TEXT,TEXT3,104,30,,,Life is Like a Box of Chocolates...,,,,TRANSPARENT
  DIALOG ADD,TRACKBAR,TB1,130,30,180,50,120,,,VERTICAL,CLICK
  DIALOG ADD,TRACKBAR,TB2,55,10,180,50,120,,,LEFT,CLICK
  DIALOG ADD,TRACKBAR,TB3,130,80,180,50,120,,,RIGHT,CLICK
  DIALOG ADD,TRACKBAR,TB4,180,10,180,50,120,,,BOTH,CLICK
  DIALOG ADD,TRACKBAR,TB5,17,145,150,50,100,,,,CLICK
  DIALOG ADD,PIECHART,PIECHART1,70,210,50,50,0,This is Piechart,CLICK,HAND
  DIALOG ADD,STATUS,SB2
  Gosub hddfree
  dialog set,piechart1,%R
  DIALOG SHOW

:evloop
  goto loop

:BUTTONokBUTTON
  goto close

:hddfree
  parse "%A;%B",@volinfo(C,FS)
  %R = @format(@fmul(@fdiv(%A,%B),100),2.0)
  exit

:PIECHART1CLICK
  info Hard disk C have %R "%" of free space@CR()@CR()Other information about main hard disk:@CR()@CR()@format(@fdiv(@volinfo(c,s),1048576),0.1) GB full size / @format(@fdiv(@volinfo(c,f),1048576),0.2) GB free size@CR()It's @volinfo(C,T)@CR()It has @volinfo(C,Y) file system @CR()It has name @volinfo(C,N)@CR()It has serial number: @volinfo(C,Z)@CR()It's loaded with Windows @Sysinfo(Winver,b)@CR()It's updated with @Sysinfo(WININFO)
  goto evloop

:TB1CLICK
  %%TB1 = @dlgtext(TB1)
  goto TB1

:TB1
  info %%TB1
  dialog set,sb2,Trackbar 1 value = %%TB1
  goto evloop

:TB2CLICK
  %%TB2 = @dlgtext(TB2)
  goto TB2

:TB2
  info %%TB2
  dialog set,sb2,Trackbar 2 value = %%TB2
  goto evloop

:TB3CLICK
  %%TB3 = @dlgtext(TB3)
  goto TB3

:TB3
  info %%TB3
  dialog set,sb2,Trackbar 3 value = %%TB3
  goto evloop

:TB4CLICK
  %%TB4 = @dlgtext(TB4)
  goto TB4

:TB4
  info %%TB4
  dialog set,sb2,Trackbar 4 value = %%TB4
  goto evloop

:TB5CLICK
  %%TB5 = @dlgtext(TB5)
  goto TB5

:TB5
  rem info %%TB5
  dialog set,sb2,Trackbar 5 value = %%TB5
  goto evloop

  rem -----------------------End Begin Child dialog program

:ASCII decoderMENU
  title ASCII decoder
  %A = @input(Create ASCII code to use with "@CHR" code@CR()@CR()@CR()Example: Enter letter @chr(64))
  if @zero(%A)
    warn You did not enter a letter...
    goto loop
  elsif
    goto ASCII decoder
  end

:ASCII decoder
  %A = @asc(%A)
  title ASCII decoder
  info You enter @chr(%A) = "@CHR("%A")"
  goto loop

:CD EjectMENU
  %L = @mci(set cdaudio door open)
  goto loop

:CD shutMENU
  %L = @mci(set cdaudio door closed)
  goto loop

:Popup EventMENU
  info You used the Popup element
  goto loop

:Hide popupMENU
  goto loop

:BeepMENU
  beep
  beep
  beep
  beep
  beep
  beep
  play Dummy.wav
  info dummy.wav is simulating Windows default sound. If Windows system sounds are disabled the PC Speaker will be heard...@CR()beep command work's only with Windows9x or ME.
  goto loop

:TEXT1CLICK
  title Program Name
  info This is info event...
  warn This is warn event...
  run Noname.exe
  shell open, http://www.vdsworld.com
  goto loop

:MS PAINTmenu
  run %S\mspaint.exe
  goto loop

:ExitMENU
  info Thanks for using VDS 5 sampler
  goto close

:Close && ExitBUTTON
  goto close

:Time1CLICK
:Time2CLICK
  run control.exe timedate.cpl
  goto loop

  rem :Error name
  Title Exiting...
  %R = Window @MSGBOX(Unknown error !!!,,ERROR,$010)
  stop

:SHAPE1CLICK
  info You Click the SHAPE MODEL...simulating ERROR !!!
  %R = Window @MSGBOX(Simulation error"," Exiting..,ERROR,$010)
  stop

:RunBUTTON
  %U = @dlgtext(edit1)
  if @zero(%U)
    Title Title name or nothing not even a title line
    warn Please enter a file name"," exe or whatever...to be started from system using shell open command !!!
  else
    shell open,%U
  end
  goto loop

:CLOSE
  if @greater(%d, 0)
    DIALOG CLOSE
    %e = @event()
    goto LOOP
  else
  end
  EXIT
  #End Program name


Ignore amp; this add VDSFroum server...

The download script is not infected with amp;



VDS 5 sampler.dsc
 Description:
VDS 5 Sampler
*Update 2a*

Download
 Filename:  VDS 5 sampler.dsc
 Filesize:  10.87 KB
 Downloaded:  2063 Time(s)



Last edited by filip on Tue Dec 27, 2005 5:24 pm; edited 14 times in total
Back to top
View user's profile Send private message Send e-mail
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 642
Location: Eastern Indiana

PostPosted: Mon Oct 17, 2005 9:49 am    Post subject: Reply with quote

wow
Thats so interesting I'm afraid to run Worship

nice work Big Smile
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Oct 19, 2005 1:21 am    Post subject: Reply with quote

good job with that Smile

next time, when you post the code, use the VDS button (at the top) as it will show the code as if it is was in the gui interface, ie. coloured and therefore easier to read

there will also be a link at the bottom of your code for people to download it

it will then look like this

Code:

warn this is easier to read


just a suggestion Smile

serge

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


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

PostPosted: Wed Oct 19, 2005 7:37 am    Post subject: Re: VDS 5 Sampler Reply with quote

filip wrote:
What's up with
rem *** problem with if/else/end and/or repeat/until structures: indention would become negative on next line ***
this is not my line


You use the "end" command while you didn't use "if" in the "ASCII decoder" label. Removing the "end" will also remove the warning... 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
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Oct 19, 2005 8:58 am    Post subject: Reply with quote

that looks so much better, well done Very Happy Very Happy Very Happy

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code 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