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 


DEBUG Mode idea for developpers of VDS apps

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Thu Mar 21, 2002 6:53 pm    Post subject: DEBUG Mode idea for developpers of VDS apps Reply with quote

In the VDS application I,m currently building (VDSWORLD Media Player), I added a Debug mode to it. What it does it simply logs every action/function in a list while the app is running. That way if your VDS app stops because of an error a log file is saved with all the action the users did and could send it to you in order for you the VDS developper to easily debug your app. Well I use for my self while testing. Cause I know sometimes we forget how we caused the error. Since my primary job is Software Quality Assurance developpers always asks us to reproduce a certain bug or simply look in a log file. Anyways hope it will help somebody.

Example:

Code:
Title My app
%%debugmode = on

option errortrap,errorsection

if @equal(%%debugmode,on)
   list create,16
   %%trace = @datetime(hh:mm:ss) Initializing My app
   gosub trace
end

if @equal(%%debugmode,on)
   %%trace = @datetime(hh:mm:ss) Initializing myapp variables
   gosub trace
end
%%somevariable = whatever

:Creating Interface
if @equal(%%debugmode,on)
   %%trace = @datetime(hh:mm:ss) Creating main interface
   gosub trace
end
  DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,BUTTON,OK,104,40,64,24,OK
  DIALOG ADD,BUTTON,Cancel,104,136,64,24,Cancel
  DIALOG ADD,BUTTON,Error,54,82,64,24,Error
  DIALOG SHOW

if @equal(%%debugmode,on)
   %%trace = @datetime(hh:mm:ss) Entering the event loop
   gosub trace
end
 
:Evloop
  wait event
  goto @event()
 
:OKBUTTON
if @equal(%%debugmode,on)
   %%trace = @datetime(hh:mm:ss) OK button has been clicked
   gosub trace
end

  info Replace this line with code to process the OKBUTTON event
  goto evloop

:errorBUTTON
  rem  generates an error
  goto whatever 

:CancelBUTTON
if @equal(%%debugmode,on)
   %%trace = @datetime(hh:mm:ss) CANCEL button has been clicked
   gosub trace
end

  info Replace this line with code to process the CancelBUTTON event
  goto evloop
 
:Close
if @equal(%%debugmode,on)
   %%trace = @datetime(hh:mm:ss) Exiting My app
   gosub trace
end
  list savefile,16,debug.log
  list close,16
  shell open,debug.log
  exit
:errorsection
  if @equal(%%debugmode,on)
     %%trace = @datetime(hh:mm:ss) MyApp got an error @error(E) on line @error(N)
     gosub trace
     list savefile,16,debug.log
     list close,16
     shell open,debug.log
  end
  warn An error @error(E) on line @error(N) has occurred.@cr()Please send this information to support.
  exit
 
:trace
  list add,16,%%trace
  exit

I don't know if it's the best way but it works for me...

Any suggestions are welcome...

Marty
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Fri Mar 22, 2002 1:04 am    Post subject: Reply with quote

If you want another example (I personnaly think much better than mine) go in the VDS 3.x Source code section to see Mac's example.


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