Page 1 of 1

Posted: Thu Mar 07, 2002 10:50 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

If this was compiled to an exe, is it a Basic app, or C app?

Code: Select all

MessageBox_(0,"Click OK to make folder C:\Test","Info",0)
CreateDirectory_("C:\Test",0)

PB - Registered PureBasic Coder

Posted: Fri Mar 08, 2002 12:54 am
by BackupUser
Restored from previous forum. Originally posted by Franco.

If you use PureBasic to compile it - an ASM application.



Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Posted: Fri Mar 08, 2002 2:12 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Nope, Franco.

If you compile it with PureBasic,
its a PureBasic application.
If you would write it in ASM, the
result would be much smaller.

cya,
...Danilo

(registered PureBasic user)

Posted: Fri Mar 08, 2002 4:31 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> If you compile it with PureBasic, its a PureBasic application.

Yes, but taking the example above, if someone asked what language it was
coded in, would you say Basic, or C? I'd say C because it's 100% API calls.
It doesn't contain any Basic keywords, after all.

PB - Registered PureBasic Coder

Posted: Fri Mar 08, 2002 4:55 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.
If you compile it with PureBasic, its a PureBasic application.
If you would write it in ASM, the result would be much smaller.
Well, there is no basic keyword in it only api calls.

The code:

MessageBox_(0,"Click OK to make folder C:\Test","Info",0)
CreateDirectory_("C:\Test",0)

is 4640 bytes with PureBasic.
Can you get it much smaller with pure asm?

Anyway, you are right PB, it looks like C code.
It seems that PureBasic is assimilating some good things of C.


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Posted: Sat Mar 09, 2002 7:29 am
by BackupUser
Restored from previous forum. Originally posted by TronDoc.

as long as it doesn't "assimilate" the complexities
of 'C' which caused me to give up on learning it.
i'm a simple-minded chap.

elecTRONics DOCtor
{registeredPB}P150 32Mb w98/DOS/Linux NO DirX NO IE :wink:

Posted: Sat Mar 09, 2002 9:54 am
by BackupUser
Restored from previous forum. Originally posted by tranquil.

The answer is quite simple.
Which compiler do you use to compile your lines?? PBCompiler, any asm Copiler or a C Compiler?

Anyway, you use PBCompile, so its an PB Application or is it possible to compile your lines in C/ASM? :)

Have a nice day.

Cheers
Mike

Tranquilizer/ Secretly!
Registred PureBasic User

Posted: Sat Mar 09, 2002 3:05 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Franco wrote:
>Well, there is no basic keyword in it only api calls.

Well, whats a "BASIC keyword" for you ??
"For", "Next" or "Repeat" ??

"PlayModule", "CreateThread" and "AttachToolBar"
are also no BASIC keywords, so a program that uses
a toolbar or sprites isnt a BASIC program ??

BTW: PB said "If this was compiled to an exe, is it a Basic app, or C app?"
Yes, __he didnt ask *how it looks*__

Why shouldnt "MessageBox_(0,"Hello World","Info",0)"
be _BASIC_ ??
Most BASIC languages are using COMMAND([ARG1, ARG2, ARG3,...]),
so it looks like plain BASIC.

>The code:
>MessageBox_(0,"Click OK to make folder C:\Test","Info",0)
>CreateDirectory_("C:\Test",0)
>
>is 4640 bytes with PureBasic.
>Can you get it much smaller with pure asm?

Sure.
You can make it smaller with PureBasic too:
--> "pbcompiler CreateDir.pb /COMMENTED", so
you get a file "purebasic.asm" in the compiler
directory.
Cut the stuff not needed here and do a
"pbcompiler /REASM" -> gives me 3.616 bytes

Thats 1024 bytes (1k) smaller than the original
.EXE --> means 22% smaller.

22 Percent smaller with 1 minute work... not bad.
(By using assembly only it would be smaller)

have fun,
...Danilo

(registered PureBasic user)


Edited by - Danilo on 09 March 2002 15:07:14