Can I check and / or compile a code in memory? ...

Just starting out? Need help? Post your questions and find answers here.
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Can I check and / or compile a code in memory? ...

Post by ShadowStorm »

Hello,

I would like to know if we can check and compile a code in memory?
When I query the compiler and I code it, it compiles it and returns the answer.

When it does this, it create files ...

In addition I am obliged to give him a code in the form of PB file
Or can I give him code in the form of text?

What I would like to do is give code in the form of text to the compiler
And it checks if all is ok and returns me the answer without writing
File to disk, all in wholesale memory.

Is it possible or not?

--------

Salut,

Je voudrait savoir si l'on peut-on vérifier et ou compiler un code en mémoire ?
Quand j’interroge le compilateur et que je lui file du code, il le compile et renvoie la réponse.

Quand il fais ça, il créer des fichiers...

De plus suis-je obliger de lui donner un code sous forme de fichier PB
ou est ce que je peut lui donner du code sous forme de texte ?

Ce que j'aimerais, c'est donner du code sous forme de texte au compilateur
et qu'il vérifie si tous est ok et me renvoi la réponse sans écrire
de fichier sur le disque, tous en mémoire en gros.

Est ce que c'est possible ou non ?
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Can I check and / or compile a code in memory? ...

Post by davido »

Are you, looking for Syntax Check in the menu under Compile , perhaps?
DE AA EB
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: Can I check and / or compile a code in memory? ...

Post by ShadowStorm »

No no it's not that at all.
Nothing to do with this.

http://www.purebasic.fr/english/viewtop ... 13&t=67832
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
#NULL
Addict
Addict
Posts: 1499
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Can I check and / or compile a code in memory? ...

Post by #NULL »

you want an interpreter but pb is a compiler.
bosker
Enthusiast
Enthusiast
Posts: 105
Joined: Fri Jan 08, 2010 11:04 pm
Location: Hampshire, UK

Re: Can I check and / or compile a code in memory? ...

Post by bosker »

I'm guessing that you want to be able to send the compiler (in /STANDBY mode) the text of your program in a block of memory.
(and perhaps get results back in memory). Is that correct?

Unfortunately, I admit I don't know of any way to do that.
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: Can I check and / or compile a code in memory? ...

Post by ShadowStorm »

Yes I think that's it :)

I send text (code) to the compiler, this one
Checks if it is ok and returns the result, ex:

"49 * (25 * (69/14))" -> OK -> 4900
But without creating a file!
All in Memory.
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
infratec
Always Here
Always Here
Posts: 7623
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Can I check and / or compile a code in memory? ...

Post by infratec »

Hi,

search for eval

Bernd
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: Can I check and / or compile a code in memory? ...

Post by ShadowStorm »

Hello

Yes thank you, I know but it's not what I want!
http://www.purebasic.fr/english/viewtop ... 13&t=67832
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Can I check and / or compile a code in memory? ...

Post by netmaestro »

I'm pretty sure you can't do that.
BERESHEIT
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Can I check and / or compile a code in memory? ...

Post by Lunasole »

Well, you can use RAM drive. That's probably one way to avoid disk writes [but not file creation]
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: Can I check and / or compile a code in memory? ...

Post by HanPBF »

http://www.purebasic.fr/english/viewtop ... lit=imdisk
Interface to ImDisk by JHPJHP; admin rights needed.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Can I check and / or compile a code in memory? ...

Post by Dude »

So basically he wants to compile/run without using any temporary files on disk. A RAM disk would do it, but that's a lot of system overhead.

I wonder what would happen if he ran PureBasic in portable mode from a locked SD card (or other non-writable media, like a DVD), and with the IDE set to create temporary files in the same folder as the source? :shock: Anyone tried that yet?
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: Can I check and / or compile a code in memory? ...

Post by ShadowStorm »

Thank you for your answers :)
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
Post Reply