Page 1 of 1

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

Posted: Tue Feb 21, 2017 6:04 pm
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 ?

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

Posted: Tue Feb 21, 2017 6:08 pm
by davido
Are you, looking for Syntax Check in the menu under Compile , perhaps?

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

Posted: Tue Feb 21, 2017 6:18 pm
by ShadowStorm
No no it's not that at all.
Nothing to do with this.

http://www.purebasic.fr/english/viewtop ... 13&t=67832

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

Posted: Tue Feb 21, 2017 6:52 pm
by #NULL
you want an interpreter but pb is a compiler.

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

Posted: Tue Feb 21, 2017 7:02 pm
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.

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

Posted: Tue Feb 21, 2017 7:21 pm
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.

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

Posted: Tue Feb 21, 2017 7:49 pm
by infratec
Hi,

search for eval

Bernd

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

Posted: Tue Feb 21, 2017 7:57 pm
by ShadowStorm
Hello

Yes thank you, I know but it's not what I want!
http://www.purebasic.fr/english/viewtop ... 13&t=67832

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

Posted: Tue Feb 21, 2017 8:50 pm
by netmaestro
I'm pretty sure you can't do that.

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

Posted: Wed Feb 22, 2017 6:14 am
by Lunasole
Well, you can use RAM drive. That's probably one way to avoid disk writes [but not file creation]

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

Posted: Wed Feb 22, 2017 7:51 am
by HanPBF
http://www.purebasic.fr/english/viewtop ... lit=imdisk
Interface to ImDisk by JHPJHP; admin rights needed.

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

Posted: Wed Feb 22, 2017 8:23 am
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?

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

Posted: Wed Feb 22, 2017 2:06 pm
by ShadowStorm
Thank you for your answers :)