Shortest PB application?

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Shortest PB application?

Post by Lubos »

Code: Select all

                
 ; Minireminder. pb -  my shortest PB application 
 ;Minireminder.exe is placed in Startup folder. Shortcut of miniREMINDER.txt will placed on the Desktop after first run of program.
 If OpenFile(0, "miniREMINDER.txt")    ; Opens an existing file or creates one, if it does not exist yet.
   If Lof(0)>6                         ; Only  window with a text will appear. Editing of windows is done through Notepad. 
       MessageBeep_(48)                ; System sounds must be allowed (default setting of Windows), if not - the program is mute.
       RunProgram("miniREMINDER.txt")  ; Name (including path) of the text file is optional only before compilation of program.
   EndIf   
 EndIf
It looks stupid but serves well! :)
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
Mohawk70
Enthusiast
Enthusiast
Posts: 404
Joined: Thu May 11, 2006 1:04 am
Location: Florida, USA

Re: Shortest PB application?

Post by Mohawk70 »

Shortest PB application ?

Code: Select all

End
:twisted:
HP Z800 Workstation
CPU : Dual Xeon 5690 3.46GHz
RAM : 96GB RAM ( 8GB x 12 )
PSU : 1100W
GPU : NVIDIA RTX 3050 8GB
STORAGE : 9TB
(4) 2TB Seagate IronWolf Pro HDD
(1) 1TB Samsung 870 EVO SSD
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Shortest PB application?

Post by IdeasVacuum »

End
:mrgreen:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Re: Shortest PB application?

Post by Lubos »

[quote="Mohawk70"]Shortest PB application ?

Code: Select all

End
As a joke possible, but if it is to be a meaningful application, ie the application that provide some service? :?
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
User avatar
Kiffi
Addict
Addict
Posts: 1503
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Shortest PB application?

Post by Kiffi »

there was already an improvement (perhaps from MachineCode?). Now it's gone?

Code: Select all

If FileSize("miniREMINDER.txt") > 6
	MessageBeep_(48)
	RunProgram("miniREMINDER.txt")
EndIf
Greetings ... Kiffi
Hygge
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Shortest PB application?

Post by applePi »

Shortest PB application :
;
:D
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Re: Shortest PB application?

Post by Lubos »

applePi wrote:Shortest PB application :
;
:D
If accept this absurd play then shortes code is zero code:
Exe file has 4 KB. :P
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Re: Shortest PB application?

Post by Lubos »

Kiffi wrote:

Code: Select all

If FileSize("miniREMINDER.txt") > 6
	MessageBeep_(48)
	RunProgram("miniREMINDER.txt")
EndIf
Well Kiffi. If miniREMIDER.text is created in advance, you are right.
I accept with your solution.
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
Lubos
Enthusiast
Enthusiast
Posts: 167
Joined: Tue Feb 03, 2004 12:32 am
Contact:

Re: Shortest PB application?

Post by Lubos »

For pranksters to explain:

Even though I know the "yellow cards" and "sticky notes" I prefer my own application for short reminders for several years. I submitted my utility for discussion in connection with the completion of my book "Surprising Basic". This book is intended for complete novices. Czech version is available at :
http://people.fsv.cvut.cz/~svobodal/pure/index.htm
Windows 7 Professional / Service Pack 1 - 32bit, PureBasic 5.46 LTS (x86)
My mother tongue is Czech. I have a Czech version of Windows.
Who is not afraid of GOTO, the one need not afraid any things!
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Shortest PB application?

Post by MachineCode »

Kiffi wrote:there was already an improvement (perhaps from MachineCode?). Now it's gone?

Code: Select all

If FileSize("miniREMINDER.txt") > 6
	MessageBeep_(48)
	RunProgram("miniREMINDER.txt")
EndIf
Yes, I deleted what you posted (with FileSize) because of this:
lubos wrote:Shortcut of miniREMINDER.txt will placed on the Desktop after first run of program.
Using FileSize won't create the text on first run, so it doesn't pass the criteria. ;)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Post Reply