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 


[Open Source]: Pre-compiler
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript Open Source Projects
View previous topic :: View next topic  
Author Message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 10, 2003 6:25 am    Post subject: Reply with quote

i understand about the functions taking a long time...may be i'll look into it when i have some time too...

are you sure about the rem lines and blank lines being removed when compliled? when i receive an error message from a user about the error being at a particular line, i find that the line in question is nearly always the same line as the one in my code...if the lines were indeed deleted then the error line would not match with my cod...does that make sense?

Serge

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


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Mon Mar 10, 2003 6:29 am    Post subject: Reply with quote

Looks like REM'd lines are not removed when compiled, although they should be..
The following code, when compiled, produces an error on line 4(which it should, although it should be line 2 without REM's)
Code:

REM Test
REM Test Again
INFO blah
IFNO blah again


Using VDS 4.5 BTW.

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 10, 2003 6:45 am    Post subject: Reply with quote

thanks for that snarlingsheep

later on tonight i will compare a compiled file with rem's and the same one with them removed to see if there is a difference in file size

Serge

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


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Mon Mar 10, 2003 6:57 am    Post subject: Reply with quote

Hmm, I added 400 REM'd lines to the above example and the file size stayed exactly the same, yet the error showed the correct line number.
I guess the compiler removes the REM'd lines but remembers how many there were and where they were.
Odd..but a good idea so you know which line to fix in your script.
With 2, 4 or 402 lines the exe was 8,704 bytes.

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Mar 10, 2003 7:33 am    Post subject: Reply with quote

thanks again for that snarlingsheep Smile

i certainly appreciated knowing exactly where an error occured in a code as reported by a user...saved a lot of time 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: Mon Mar 10, 2003 4:01 pm    Post subject: Reply with quote

Hi Serge,

REM lines are replaced by VDS into blank lines when compiling, so that the line numbers are right... So I donīt think you should remove the empty lines, otherwise it will be hard to find errors in it....
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Apr 03, 2003 1:19 pm    Post subject: Reply with quote

does any one have a list of the shortcuts for the functions such as @asc() can be changed to @a()?

i was thinking of adding that to the pre-compile code...

thanks in advance

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: Thu Apr 03, 2003 5:06 pm    Post subject: Reply with quote

I think you have to search it out yourself... I least, that's how I did it with my code...
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Apr 03, 2003 9:23 pm    Post subject: Reply with quote

i started to do that skit3000 but then thought that perhaps someone had already done that...

i'll continue with what i've started

thanks skit

Serge

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


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sun Apr 13, 2003 10:57 pm    Post subject: Reply with quote

hi all,

i have finished with the shortcutting of the functions (bad english?)...you disappointingly get a saving of 4% but it does make the code that much harder to read... a good thing against hacking?

note that i have made some changes to the interface too

Code:
rem === This is an interface to support and extend the code that skit3000
rem === put together as a pre-compile program to reduce the size of compiled
rem === exe files.
rem ===                                                                     
rem === My extension essentially enables you to easily edit the dsp file values
rem === so that you can both reduce the size of the compiled program and you
rem === can edit the information to be included with the compiled program at
rem === the same time - hopefully a great time saver.
rem ===                                                                     
rem === Feel free to edit/change this code to suit your needs. Note that some
rem === default values will need to be changed to meet your particular needs.
rem ===                                                                     
rem === Enjoy!
rem ===                                                                     
rem === Serge   

option fieldsep, .
option scale, 96

Title Pre-Compile
  DIALOG CREATE,Pre-Compile,-1,0,668,560
REM *** Modified by Dialog Designer on 6/04/03 - 15:25 ***
  DIALOG ADD,STYLE,UNDERLINE,,,U,,BLUE
  DIALOG ADD,TEXT,TEXT1,10,10,,,VDS File
  DIALOG ADD,EDIT,EDIT1,25,10,180,20
  DIALOG ADD,BUTTON,browse_b,55,40,110,25,&Browse
  DIALOG ADD,TEXT,TEXT2,90,10,,,Original EXE File Name
  DIALOG ADD,EDIT,EDIT2,105,10,180,20
  DIALOG ADD,TEXT,TEXT3,135,10,,,File/Product Version and...
  DIALOG ADD,SPIN,SPIN1,150,10,40,22
  DIALOG ADD,SPIN,SPIN2,150,60,40,22
  DIALOG ADD,SPIN,SPIN3,150,110,40,22
  DIALOG ADD,TEXT,TEXT4,135,155,,,...Build
  DIALOG ADD,SPIN,SPIN4,150,160,40,22
  DIALOG ADD,TEXT,TEXT5,180,10,,,Product Name
  DIALOG ADD,EDIT,EDIT3,195,10,180,20
  DIALOG ADD,TEXT,TEXT6,220,10,,,Current Date
  DIALOG ADD,EDIT,EDIT4,235,10,180,20
  DIALOG ADD,TEXT,TEXT7,260,10,,,Company Name,,CLICK,UNDERLINE,HAND
  DIALOG ADD,EDIT,EDIT5,280,10,180,20
  DIALOG ADD,TEXT,TEXT8,310,10,,,Program Description
  DIALOG ADD,EDIT,EDIT6,325,10,180,50,,,MULTI,SCROLL,WRAP
  DIALOG ADD,TEXT,TEXT9,380,10,,,Copyright,,CLICK,UNDERLINE,HAND
  DIALOG ADD,EDIT,EDIT7,400,10,180,40,,,MULTI,SCROLL,WRAP
  DIALOG ADD,TEXT,TEXT10,10,220,,,VDS Code
  DIALOG ADD,LIST,LIST1,30,220,400,440
  DIALOG ADD,BUTTON,compile_b,454,116,76,80,&Pre-Compile
  DIALOG ADD,STYLE,PIE_STYLE,,,,YELLOW,RED
  DIALOG ADD,PIECHART,PIECHART1,488,440,62,42,0,,,PIE_STYLE
  DIALOG ADD,TEXT,TEXT11,485,220,,,File:
  DIALOG ADD,TEXT,TEXT12,510,220,,,Pre-Compiled:
  DIALOG ADD,BUTTON,quit_b,488,520,92,42,&Quit
  DIALOG ADD,LEVEL,LEVEL1,14,630,30,456,0
  DIALOG ADD,STATUS,STATUS
  DIALOG ADD,SHAPE,SHAPE1,518,630,30,12,SILVER,BLACK,,RECTANGLE
  DIALOG ADD,SHAPE,SHAPE2,508,630,30,12,SILVER,BLACK,,RECTANGLE
  DIALOG ADD,SHAPE,SHAPE3,498,630,30,12,SILVER,BLACK,,RECTANGLE
  DIALOG ADD,CHECK,CHECK1,455,10,50,18,REM
  DIALOG ADD,CHECK,CHECK2,475,10,76,18,Trim
  DIALOG ADD,CHECK,CHECK3,495,10,70,18,Commands
  DIALOG ADD,CHECK,CHECK4,515,9,76,18,Functions
  DIALOG ADD,SHAPE,SHAPE4,488,630,30,12,SILVER,BLACK,,RECTANGLE
  DIALOG SHOW
 
  gosub functions_data
 
  dialog disable, compile_b
  dialog set, piechart1, 100
  dialog set, edit4, @datetime(mmmm yyyy)
  list create, 1
  list create, 2
  dialog set, check1, 1
  dialog set, check2, 1
  dialog set, check3, 1
  dialog set, check4, 1

:Evloop
  wait event
  goto @event()

:browse_bBUTTON
  %%dummy = @filedlg(*.dsc,Open...)
 
  if @ok()
  else
      goto evloop
  end
 
  if %%dummy
      %%file = %%dummy
      dialog enable, compile_b
      dialog set, edit1, @name(%%dummy).dsc
    dialog set, status, @path(%%dummy)
   
    rem === loads code ===
    list clear,1
    list loadfile,1,%%file
    list loadfile, list1, @path(%%dummy)@name(@dlgtext(edit1)).dsc
    %%file_size = @file(%%dummy,z)
    dialog set, text11, File: %%file_size bytes + @count(list1) lines
    dialog set, text12, Pre-Compiled:
   
    dialog set, piechart1, 100
    dialog set, level1, 0
    dialog set, shape1, red
    dialog set, shape2, red
    dialog set, shape3, red
    dialog set, shape4, red
   
    rem === loads values from dsp file ===
    inifile open, @path(%%dummy)@name(@dlgtext(edit1)).dsp
    dialog set, edit5, @iniread(Compiler, CompanyName)
    dialog set, edit2, @iniread(Compiler, OriginalFilename)
    %%file_version = @iniread(Compiler, FileVersion)
    parse "%1;%2;%3;%4", %%file_version
    dialog set, spin1, %1
    dialog set, spin2, %2
    dialog set, spin3, %3
    dialog set, spin4, %4
    dialog set, edit3, @iniread(Compiler, ProductName)
    dialog set, edit6, @iniread(Compiler, FileDescription)
    dialog set, edit7, @iniread(Compiler, LegalCopyright)
  end
  goto evloop
 
:text7CLICK
  rem === default value ===
  dialog set, edit5, Cattle Ramp Software
  goto evloop
 
:text9CLICK
  rem === default value ==
  dialog set, edit7, Đ Serge M Botans"," All Rights Reserved"," @datetime(mmmm yyyy)
  goto evloop 

:quit_bBUTTON
:Close
  exit

:compile_bBUTTON
dialog set, shape1, red
dialog set, shape2, red
dialog set, shape3, red
dialog set, shape4, red
   
rem === update dsp file ===
inifile write, Compiler, CompanyName, @dlgtext(edit5)
inifile write, Compiler, OriginalFilename, @dlgtext(edit2)
inifile write, Compiler, FileVersion, @dlgtext(spin1).@dlgtext(spin2).@dlgtext(spin3).@dlgtext(spin4)
inifile write, Compiler, ProductName, @dlgtext(edit3)
inifile write, Compiler, FileDescription, @dlgtext(edit6)
inifile write, Compiler, ProductVersion, @dlgtext(spin1).@dlgtext(spin2).@dlgtext(spin3).@dlgtext(spin4)
inifile write, Compiler, LegalCopyright, @dlgtext(edit7)

rem === code below is by skit3000 ===
dialog cursor, wait

rem === my added code to update the code with version, build and date ===
list seek, 1, 0
if @greater(@match(1,"%%version ="),0)
   list put, 1, "%%version = "@dlgtext(spin1).@dlgtext(spin2)
else
   list seek, 1, 0
   list insert, 1, "%%version = "@dlgtext(spin1).@dlgtext(spin2)
end

if @greater(@match(1,"%%release ="),0)
   list put, 1, "%%release = "@dlgtext(spin3)
else
   list seek, 1, 1
   list insert, 1, "%%release = "@dlgtext(spin3)
end

if @greater(@match(1,"%%build ="),0)
   list put, 1, "%%build = "@dlgtext(spin4)
else
   list seek, 1, 2
   list insert, 1, "%%build = "@dlgtext(spin4)
end

if @greater(@match(1,"%%date ="),0)
   list put, 1, "%%date = "@dlgtext(edit4)
else
   list seek, 1, 3
   list insert, 1, "%%date = "@dlgtext(edit4)
end

rem === my added code to remove all blank lines and all rem lines ===
if @not(@dlgtext(check1))
   goto trim
end
list seek, 1, 0
%i = 0
repeat
   list seek, 1, %i
   if @greater(@pos(rem ,@item(1)),0)@null(@trim(@item(1)))
        list delete, 1
     %i = @pred(%i)
     if @greater(%i,0)
         %i = @pred(%i)
     end
   end
   %i = @succ(%i)
   dialog set, level1, @div(@fmul(%i,100),@count(1))
until @equal(%i,@count(1))
list clear, list1,
list assign, list1, 1

:trim
dialog set, shape1, ltgreen

if @not(@dlgtext(check2))
   goto commands
end

rem === code below is by skit3000 ===
list clear, 2
%z = 0
repeat
   list add,2,@trim(@item(1,%z))
   %z = @succ(%z)
   dialog set, level1, @div(@fmul(%z,100),@count(1))
until @equal(%z,@count(1))
list clear, 1
list assign, 1, 2
list clear, 2
list clear, list1,
list assign, list1, 1

:commands
dialog set, shape2, ltgreen

if @not(@dlgtext(check3))
   goto functions
end

rem list clear,1
rem list assign,1,2
rem list clear,2

%z = 0

repeat
%%item = @item(1,%z)

%%command = @substr(%%item,1,3)

if @not(@equal(@pos(@chr(32),%%item),0))
  if @not(@equal(@pos(@chr(44),%%item),0))
    %%subcommand = @substr(%%item,@succ(@pos(@chr(32),%%item)),@pred(@pos(@chr(44),%%item)))
   else
   %%subcommand = @substr(%%item,@succ(@pos(@chr(32),%%item)),@len(%%item))
   end
  else
  %%subcommand =
  end

if @not(@equal(@pos(@chr(44),%%item),0))
  %%parameters = @substr(%%item,@succ(@pos(@chr(44),%%item)),@len(%%item))
  else
  %%parameters =
  end

if @equal(@substr(%%item,1,1),":")@equal(@substr(%%item,1,1),"%")
  %%pass = true
  end

rem - BEEP -
if @equal(%%command,BEE)
%%com = true
  %%command = BE
  end
rem - BINFILE -
if @equal(%%command,BIN)
%%com = true
  %%command = BI
  if @equal(%%subcommand,OPEN)
    %%subcommand = O
    end
  if @equal(%%subcommand,CLOSE)
    %%subcommand = C
    end
  if @equal(%%subcommand,SEEK)
    %%subcommand = S
    end
  if @equal(%%subcommand,WRITE)
    %%subcommand = W
    end
  end
rem - CLIPBOARD -
if @equal(%%command,CLI)
%%com = true
  %%command = C
  if @equal(%%subcommand,APPEND)
    %%subcommand = AP
   end
  if @equal(%%subcommand,CLEAR)
    %%subcommand = C
   end
  if @equal(%%subcommand,SET)
    %%subcommand = S
   end
  end
rem - DDE -
if @equal(%%command,DDE)
%%com = true
  %%command = DD
  if @equal(%%subcommand,LINK)
    %%subcommand = L
   end
  if @equal(%%subcommand,EXECUTE)
    %%subcommand = E
   end
  if @equal(%%subcommand,POKE)
    %%subcommand = P
   end
  if @equal(%%subcommand,TERMINATE)
    %%subcommand = T
   end
  end
rem - DIALOG -
if @equal(%%command,DIA)
%%com = true
  %%command = D
  if @equal(%%subcommand,ADD)
    %%subcommand = AD
    end
  if @equal(%%subcommand,CLEAR)
    %%subcommand = CL
    end
  if @equal(%%subcommand,CLEARSEL)
    %%subcommand = CLEARS
    end
  if @equal(%%subcommand,CLOSE)
    %%subcommand = CLO
    end
  if @equal(%%subcommand,CREATE)
    %%subcommand = CR
    end
  if @equal(%%subcommand,CURSOR)
    %%subcommand = CUR
    end
  if @equal(%%subcommand,DISABLE)
    %%subcommand = DI
    end
  if @equal(%%subcommand,ENABLE)
    %%subcommand = EN
    end
  if @equal(%%subcommand,FOCUS)
    %%subcommand = F
    end
  if @equal(%%subcommand,HIDE)
    %%subcommand = HI
    end
  if @equal(%%subcommand,POPUP)
    %%subcommand = POP
    end
  if @equal(%%subcommand,SELECT)
    %%subcommand = SEL
    end
  if @equal(%%subcommand,SET)
    %%subcommand = S
    end
  if @equal(%%subcommand,SETPOS)
    %%subcommand = SETP
    end
  if @equal(%%subcommand,SHOW)
    %%subcommand = SH
    end
  if @equal(%%subcommand,SHOWMODAL)
    %%subcommand = SHOWM
    end
  if @equal(%%subcommand,TITLE)
    %%subcommand = T
    end
  end
rem - DIRECTORY -
if @equal(%%command,DIR)
%%com = true
  %%command = DIRE
  if @equal(%%subcommand,CHANGE)
    %%subcommand = C
    end
  if @equal(%%subcommand,CREATE)
    %%subcommand = CR
    end
  if @equal(%%subcommand,DELETE)
    %%subcommand = D
    end
  if @equal(%%subcommand,RENAME)
    %%subcommand = REN
    end
  end
rem - ELSE / ELSIF -
if @equal(%%command,ELS)
%%com = true
  if @equal(@substr(%%item,1,4),ELSE)
    %%command = E
   else
   %%command = ELSIF
   end
  end
rem - END -
if @equal(%%command,END)
%%com = true
  %%command = EN
  end
rem - EXIT / EXITWIN -
if @equal(%%command,EXI)
%%com = true
  if @equal(@substr(%%item,1,5),EXITW)
    %%command = EXITW
   if @equal(%%subcommand,SHUTDOWN)
     %%subcommand = SHU
     end
   if @equal(%%subcommand,REBOOT)
     %%subcommand = REB
     end
   if @equal(%%subcommand,LOGOFF)
     %%subcommand = LOG
     end
   if @equal(%%subcommand,POWEROFF)
     %%subcommand = POW
     end
   if @equal(%%subcommand,FORCE)
     %%subcommand = FOR
     end
   else
   %%command = EX
   end
  end
rem - EXTERNAL -
if @equal(%%command,EXT)
  %%com = true
  if @equal(@substr(%%command,1,4),EXTE)
    %%command = EXT
   else
   %%command = EXT
   end
  end
rem - FILE -
if @equal(%%command,FIL)
%%com = true
  %%command = FIL
  if @equal(%%subcommand,COPY)
    %%subcommand =C
   end
  if @equal(%%subcommand,DELETE)
    %%subcommand = D
   end
  if @equal(%%subcommand,RENAME)
    %%subcommand = R
   end
  if @equal(%%subcommand,SETDATE)
    %%subcommand = SETD
   end
  if @equal(%%subcommand,SETATTR)
    %%subcommand = SETA
   end
  end
rem - FONT -
if @equal(%%command,FON)
%%com = true
  %%command = FON
  if @equal(%%subcommand,ADD)
    %%subcommand = AD
    end
  if @equal(%%subcommand,REMOVE)
    %%subcommand = RE
   end
  end
rem - GOSUB -
if @equal(%%command,GOS)
%%com = true
  %%command = G
  end
rem - GOTO -
if @equal(%%command,GOS)
%%com = true
  %%command = GOT
  end
rem - IF -
if @equal(%%command,IF )
%%com = true
  %%command = IF
  end
rem - INFO -
if @equal(%%command,INF)
%%com = true
  %%command = IN
  end
rem - INIFILE -
if @equal(%%command,INI)
%%com = true
  %%command = INI
  if @equal(%%subcommand,OPEN)
    %%subcommand = O
   end
  if @equal(%%subcommand,WRITE)
    %%subcommand = W
   end
  end
rem - LINK -
if @equal(%%command,LIN) 
%%com = true
  %%command = LIN
  %%subcommand = CREATE
  end
rem - LIST -
if @equal(%%command,LIS)
%%com = true
  %%command = LI
  if @equal(%%subcommand,ADD)
    %%subcommand =ADD
   end
  if @equal(%%subcommand,APPEND)
    %%subcommand = AP
   end
  if @equal(%%subcommand,ASSIGN)
    %%subcommand = AS
   end
  if @equal(%%subcommand,CLEAR)
    %%subcommand = CLE
   end
  if @equal(%%subcommand,CLOSE)
    %%subcommand = CL
   end
  if @equal(%%subcommand,COPY)
    %%subcommand = CO
   end
  if @equal(%%subcommand,CREATE)
    %%subcommand = C
   end
  if @equal(%%subcommand,DELETE)
    %%subcommand = DE
   end
  if @equal(%%subcommand,INSERT)
    %%subcommand = IN
   end
  if @equal(%%subcommand,PASTE)
    %%subcommand = PA
   end
  if @equal(%%subcommand,PUT)
    %%subcommand = PU
   end
  if @equal(%%subcommand,REVERSE)
    %%subcommand = REV
   end
  if @equal(%%subcommand,SEEK)
    %%subcommand = S
   end
  if @equal(%%subcommand,DROPFILES)
    %%subcommand = DR
   end
  if @equal(%%subcommand,FILELIST)
    %%subcommand = F
   end
  if @equal(%%subcommand,LOADFILE)
    %%subcommand = LOA
   end
  if @equal(%%subcommand,LOADTEXT)
    %%subcommand = LOADT
   end
  if @equal(%%subcommand,REGKEYS)
    %%subcommand = REG
   end
  if @equal(%%subcommand,REGVALS)
    %%subcommand = REGV
   end
  if @equal(%%subcommand,SAVEFILE)
    %%subcommand = SA
   end
  if @equal(%%subcommand,WINLIST)
    %%subcommand = W
   end
  end
rem - OPTION -
if @equal(%%command,OPT)
%%com = true
  %%command = O
  %%subcommand = @substr(%%subcommand,1,4)
  end
rem - PARSE -
if @equal(%%command,PAR) 
%%com = true
  %%command = PA
  end
rem - PLAY -
if @equal(%%command,PLA)
%%com = true
  %%command = PL
  end
rem - RANDOM -
if @equal(%%command,RAN)
%%com = true
  %%command = RA
  end
rem - REGISTRY
if @equal(%%command,REG)
%%com = true
  %%command = R
  if @equal(%%subcommand,DELETE)
    %%subcommand = D
   end
  if @equal(%%subcommand,WRITE)
    %%subcommand = W
   end
  end
rem - REPEAT -
if @equal(%%command,REP)
%%com = true
  %%command = REP
  end
rem - UNTIL -
if @equal(%%command,UNT)
%%com = true
  %%command = U
  end
rem - RUN - 
if @equal(%%command,RUN)
%%com = true
  rem Don't do anything, because it can be RUN, RUNH, RUNM & RUNZ
  end
rem - SHELL -
if @equal(%%command,SHE)
%%com = true
  %%command = SHE
  end
rem - SHIFT -
if @equal(%%command,SHI)
%%com = true
  %%command = S
  end
rem - STOP -
if @equal(%%command,STO)
%%com = true
  %%command = ST
  end
rem - TASKBAR -
if @equal(%%command,TAS)
%%com = true
  %%command = TA
  end
rem - TIMER -
if @equal(%%command,TIM) 
%%com = true
  %%command = TIM
  if @equal(%%subcommand,START)
    %%subcommand = STA
   end
  if @equal(%%subcommand,STOP)
    %%subcommand = STO
   end
  if @equal(%%subcommand,PAUSE)
    %%subcommand = PAU
   end
  end
rem - TITLE -
if @equal(%%command,TIT)
%%com = true
  %%command = T
  end 
rem - WAIT -
if @equal(%%command,WAI)
%%com = true
  %%command = W
  end
rem - WEND -
if @equal(%%command,WEN)
%%com = true
  %%command = WE
  end
rem - WHILE -
if @equal(%%command,WHI)
%%com = true
  %%command = WH
  end
rem - WARN -
if @equal(%%command,WAR)
%%com = true
  %%command = WAR
  end
rem - WINDOW / WINHELP -
if @equal(%%command,WIN)
%%com = true
if @equal(@substr(%%item,1,4),WIND)
    rem - WINDOW -
    %%command = WI
    if @equal(%%subcommand,ACTIVATE)
      %%subcommand = A
     end
    if @equal(%%subcommand,CLICK)
      %%subcommand = CLI
     end
    if @equal(%%subcommand,CLOSE)
      %%subcommand = CL
     end
    if @equal(%%subcommand,FLASH)
      %%subcommand = F
       end
    if @equal(%%subcommand,HIDE)
      %%subcommand = H
     end
    if @equal(%%subcommand,ICONIZE)
      %%subcommand = IC
     end
    if @equal(%%subcommand,MAXIMZE)
      %%subcommand = M
     end
    if @equal(%%subcommand,NORMAL)
      %%subcommand = NO
     end
    if @equal(%%subcommand,ONTOP)
      %%subcommand = ONT
     end
    if @equal(%%subcommand,POSITION)
      %%subcommand = PO
     end
    if @equal(%%subcommand,SEND)
      %%subcommand = SE
     end
    if @equal(%%subcommand,SETTEXT)
      %%subcommand = SET
     end
   else
   rem - WINHELP -
   %%command = WINH
   end
  end

if @equal(%%pass,true)
  %%pass = false 
   
   rem VARIABLE!
    if @equal(@substr(%%item,1,1),"%")
     %%varname = @substr(%%item,1,@pos(=,%%item))
      end
 
  list add,2,%%item
  else
  if @equal(%%com,true)
    %%com = false
    if @not(@equal(%%parameters,))
      list add,2,%%command %%subcommand@chr(44)%%parameters
      else
      list add,2,%%command %%subcommand
      end
   else
   list add,2,%%item
   end
  end
 
%z = @succ(%z)
dialog set, level1, @div(@fmul(%z,100),@count(1))
until @equal(%z,@count(1))

list clear, list1
list assign,list1, 2
list clear, 1
list assign, 1, 2

:functions
dialog set, shape3, ltgreen

if @not(@dlgtext(check4))
   goto save
end

rem === my added code to change function names ===
list seek, 1, 0
list seek, 10, 0
%i = 0
repeat
   list seek, 10, %i
   %%test_function = @trim(@substr(@item(10),1,11))
   repeat
        if @equal(@match(1,%%test_function),1)
         %%current_line = @item(1)
         %%function_position = @pos(%%test_function,%%current_line)
            %%current_line = @strdel(%%current_line,%%function_position,@fsub(@fadd(%%function_position,@len(%%test_function)),1))
        %%current_line = @strins(%%current_line,%%function_position,@trim(@substr(@item(10),12,20)))
         list put, 1, %%current_line
       rem list seek, 1, 0
       rem info %%test_function<>%%current_line<>@trim(@substr(@item(10),12,20))
        end
   until @null(@match(1,%%test_function))
   list seek, 1, 0
   %i = @succ(%i)
   dialog set, level1, @div(@fmul(%i,100),@count(10))
until @equal(%i,@count(10))
list clear, list1,
list assign, list1, 1


:save
dialog set, shape4, ltgreen
rem === displays and saves the new code ===
clipboard set,@text(1)

list savefile,1,@path(%%file)@name(%%file)_compile_ready.dsc
file copy, @path(%%dummy)@name(@dlgtext(edit1)).dsp,@path(%%file)@name(%%file)_compile_ready.dsp

list clear, list1
list assign,list1,1

rem dialog set, edit8, @text(2)
%%new_file_size = @file(@path(%%file)@name(%%file)_compile_ready.dsc ,z)
%%percentage = @div(@fmul(%%new_file_size,100),%%file_size)
dialog set, text12, Pre-Compiled: %%new_file_size bytes (%%percentage%) + @count(list1) lines

dialog set, piechart1, %%percentage

dialog cursor,

if @ask(Do you want to open the converted file with VDS?)
  shell open,@path(%%file)@name(%%file)_compile_ready.dsc
end

goto evloop

:functions_data
list create, 10
list loadtext, 10
"@asc        @a
"@alt        @al
"@binfile    @bi
"@both       @bo
"@chr        @c
"@click      @cl
"@count      @co
"@colordlg   @col
"@ctrl       @ct
"@curdir     @cu
"@div        @d
"@datetime   @da
"@diff       @dif
"@dirdlg     @dir
"@dlgpos     @dlgp
"@dlgtext    @dlgt
"@equal      @e
"@env        @en
"@error      @er
"@esc        @es
"@event      @ev
"@ext        @ex
"@file       @f
"@fadd       @fa
"@fatn       @fat
"@fcos       @fc
"@fdiv       @fd
"@fexp       @fe
"@filedlg    @filed
"@fln        @fl
"@fmul       @fm
"@focus      @foc
"@fontdlg    @fon
"@format     @for
"@fsub       @fs
"@fsin       @fsi
"@fsqt       @fsq
"@greater    @g
"@hex        @he
"@iniread    @i
"@index      @ind
"@input      @inp
"@item       @it
"@key        @k
"@len        @l
"@lower      @lo
"@match      @m
"@msgbox     @ms
"@name       @n
"@next       @ne
"@not        @no
"@null       @nu
"@numeric    @num
"@ok         @o
"@pred       @p
"@path       @pa
"@pos        @po
"@prod       @pro
"@query      @q
"@random     @ra
"@regread    @reg
"@sendmsg    @se
"@shift      @shi
"@shortname  @sho
"@strdel     @strd
"@strins     @stri
"@substr     @sub
"@succ       @suc
"@sysinfo    @sy
"@sum        @s
"@tab        @ta
"@text       @te
"@timer      @ti
"@trim       @trim
"@upper      @u
"@volinfo    @v
"@verinfo    @ve
"@winactive  @winac
"@winatpoint @winat
"@winclass   @winc
"@windir     @windi
"@window     @windo
"@winexists  @wine
"@winpos     @winp
"@wintext    @wint
"@zero       @z
exit



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 Open Source Projects All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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