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 


Retreive Program Source Code

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Apr 03, 2003 10:21 pm    Post subject: Retreive Program Source Code Reply with quote

Hi all,

Here's a little script to give you the idea of how to retreive the source code
to your program if you're worried about losing it:

Code:
if @equal(%1,get_source)
  if @winexists(#Notepad)
    %%pass = @input(" ")
      if @not(@ok())
        exit
      end
          if @equal(%%pass,Your-Password,EXACT)
         GOSUB ShowSource
          end
  end
end
exit

:ShowSource
list create,1
list loadtext,1
"if @equal(%1,get_source)
"  if @winexists(#Notepad)
"    %%pass = @input(" ")
"      if @not(@ok())
"        exit
"      end
"   GOSUB ShowSource
"  end
"end
"exit
"
":ShowSource
""list create,1
""list loadtext,1
""list savefile,1,@path(%0)source.dsc
""list close,1
""stop
list savefile,1,@path(%0)source.dsc
list close,1
stop

_________________
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: Fri Apr 04, 2003 2:43 pm    Post subject: Reply with quote

FreezingFire, maybe you should make a little tool which puts the sourcecode into a list before compiling... Otherwise you'll have to put a lot of "s around by hand...
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Apr 04, 2003 10:05 pm    Post subject: Reply with quote

Well here's something simple which will put a source file with quotes in
front of it. Smile

Code:
Title Show Source Wizard
  DIALOG CREATE,Show Source Wizard,-1,0,310,85,NOMIN
  DIALOG ADD,TEXT,TIn,8,12,,,Input DSC:
  DIALOG ADD,EDIT,EInput,24,12,260,19
  DIALOG ADD,BITBTN,BBr1,24,276,24,19,,Find
  DIALOG ADD,BUTTON,BGo,52,104,88,24,Process...,,DEFAULT
  DIALOG SHOW
:Evloop
  wait event
  goto @event()
:BBr1BUTTON
  %F = @filedlg("Visual DialogScript Source Code (*.dsc)|*.dsc")
    if @ok()
      dialog set,EInput,%F
   end
  goto evloop
:BGoBUTTON
  GOSUB Process
    if %%out
     info The processed file was saved as @name(%%out).@ext(%%out)
     shell open,%%out
     goto close
    end
  goto evloop
:Process
list create,1
list loadfile,1,@dlgtext(EInput)
%x = 0
repeat
list seek,1,%x
list put,1,@chr(34)@item(1)
%x = @succ(%x)
until @equal(%x, @count(1))
%%out = @path(@dlgtext(EInput))@name(@dlgtext(EInput))"_processed.dsc"
list savefile,1,%%out
list close,1
exit

:Close
  exit

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


Joined: 03 Sep 2005
Posts: 403
Location: Australia

PostPosted: Fri Nov 18, 2005 5:11 pm    Post subject: Reply with quote

Just thought I'd share a little tool I use from VDS' Tools menu to extract the source from my programs.

Code:
Title VDS Source Xtracta

  DIALOG CREATE,VDSsrc Xtracta,-1,-1,322,105,NOMIN
  DIALOG ADD,GROUP,GROUP1,10,13,296,49,VDS exe to extract source from
  DIALOG ADD,BUTTON,Extract,70,129,64,24,Extract,,DEFAULT
  DIALOG ADD,BUTTON,Find,28,264,36,22,Find
  DIALOG ADD,EDIT,EDIT1,29,23,237,20
  DIALOG SHOW
 
:EvLoop
  wait event
  goto @event()

:FindBUTTON
  %F = @filedlg("VDS Executable (*.exe)|*.exe|VDS Compiled Source Unit (*.dsu)|*.dsu",Select VDS Application)
  if @not(@null(%F))
    rem info You selected %F
    dialog set,EDIT1,%F
  end
  goto evloop

:ExtractBUTTON
  run @chr(34)%F@chr(34) get_source
 
:Close
 exit 

_________________
cheers

DaveŽ
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base 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