Ultimate Bug Fix Button

For everything that's not in any way related to PureBasic. General chat etc...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Ultimate Bug Fix Button

Post by IdeasVacuum »

Doesn't it drive you crazy when you can't fix your own bug?

What we really need is an enhancement to the PB IDE, a bug fix button which:

1) Completely removes the project from the computer;

2) Applies a System Restore to your brain, back to the time before you started the project, so you do not know you were working on it.

:shock: :mrgreen:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
idle
Always Here
Always Here
Posts: 6031
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Ultimate Bug Fix Button

Post by idle »

Code: Select all

Structure bottle
  type.s 
  size.i 
EndStructure   
  
Procedure OpenBottle(bottle.s,ml)
  Protected *obj.bottle 
  *obj = AllocateMemory(SizeOf(bottle)) 
  *obj\size = ml
  *obj\type = bottle
  PrintN("Opening " + Str(ml) + " ml bottle of " + bottle)
  ProcedureReturn *obj
EndProcedure 

Procedure Drink(*drink.bottle,ml) 
  If *drink\size > 0 
    PrintN("glug glug glug") 
    *drink\size - ml
    Delay(150)
    ProcedureReturn 1 
  Else 
    PrintN("arrhhh") 
    ProcedureReturn 0
  EndIf  
 EndProcedure 
 
 Procedure CloseBottle(*drink)
   FreeMemory(*drink) 
   Delay(500)
  EndProcedure  
  
 OpenConsole()

#PB_Whisky = "laphroaig"
file.s = ProgramParameter(0)
If FileSize(file.s)
   ;DeleteFile(file)
EndIf 

*drink.bottle = OpenBottle(#PB_Whisky,750)
If *drink 
  While Drink(*drink,50)
  Wend 
  CloseBottle(*drink)
EndIf    

 
Windows 11, Manjaro, Raspberry Pi OS
Image
akj
Enthusiast
Enthusiast
Posts: 668
Joined: Mon Jun 09, 2003 10:08 pm
Location: Nottingham

Re: Ultimate Bug Fix Button

Post by akj »

@idle:

I hope you realise that after drinking a full bottle of whisky, the program will be in no fit state to:

Code: Select all

CloseBottle(*drink)
Far better for the program just to "crash out" instead.
Anthony Jordan
Post Reply