Sign in to follow this  
Followers 0
Somebody Someware

Converting an variable to a string

12 posts in this topic

I have made an installation program but the problem is that I have to use a variable to get the file details but I can't put an variable in the "source" part of FileInstall.

Is there a way to convert an variable to a string?

Please help me.


Go to This site for my best product!

Share this post


Link to post
Share on other sites



Search and replace..:P

Either from the editor or make a search and replace preprocessor.

Something like (untested):

$data = FileRead($sourcefile)
$newdata = StringReplace($data, $search, $replace)
FileWrite($sourcefile, $newdata)

Share this post


Link to post
Share on other sites

Search and replace..:P

Either from the editor or make a search and replace preprocessor.

Something like (untested):

$data = FileRead($sourcefile)
$newdata = StringReplace($data, $search, $replace)
FileWrite($sourcefile, $newdata)

But FileInstall doesn't work with an variable in the source.


Go to This site for my best product!

Share this post


Link to post
Share on other sites

But FileInstall doesn't work with an variable in the source.

yes, that's exactly what the help file says!

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

yes, that's exactly what the help file says!

Cheers

Kurt

I KNOW THAT!!!

THAT'S WHY I'M ASKING FOR A WAY TO CONVERT AN VARIABLE TO A STRING!!!


Go to This site for my best product!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I KNOW THAT!!!

THAT'S WHY I'M ASKING FOR A WAY TO CONVERT AN VARIABLE TO A STRING!!!

DON'T SHOUT AT ME! UTEN TOLD YOU HOW TO DO IT !!! WRITE A PREPROCESSOR

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I KNOW THAT!!!

THAT'S WHY I'M ASKING FOR A WAY TO CONVERT AN VARIABLE TO A STRING!!!

First of all: Don't shout !

Secondly... Fileinstall does not work with a variable for Input since it needs it at Compilation time not execution time.

:P

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

DON'T SHOUT AT ME! UTEN TOLD YOU HOW TO DO IT !!! WRITE A PREPROCESSOR

Sorry for the shouting but I think the problem still isn't clear.

I just want an string to be a variable like:

"string1"=$variable1

So FileInstall wil work.

B.T.W. I will try his way but I tought it was something else then I ment.

Edited by Somebody Someware

Go to This site for my best product!

Share this post


Link to post
Share on other sites

Sorry for the shouting but I think the problem still isn't clear.

I just want an string to be a variable like:

"string1"=$variable1

So FileInstall wil work.

The problem is totally clear!

Three people told that it is NOT POSSIBLE what you want and one proposed a solution.... If I were you, I would take the solution...

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

The problem is totally clear!

Three people told that it is NOT POSSIBLE what you want and one proposed a solution.... If I were you, I would take the solution...

Cheers

Kurt

The solution doesn't work.

I think I just have to bundle all files without an IniRead operation.

I thank you all for doing your best and I'm sorry for the shouting etc.

Please forgive me.


Go to This site for my best product!

Share this post


Link to post
Share on other sites

The solution doesn't work.

oh, can you tell us why it doesn't work?


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

The solution doesn't work.

I think I just have to bundle all files without an IniRead operation.

I thank you all for doing your best and I'm sorry for the shouting etc.

Please forgive me.

The preprocessor solution will work. It will only add one more step for you when you want to generate and run the file. And you have to put the IniRead (and possibly IniWrite to know wat to replace the next time) in the preprocessor.

So when you want to compile your application you would do:

preprocessor.exe <your script file>

aut2exe.exe <your scriptfile>

Or, if you use SciTE, you could try to figure out something with

#compiler_run_before

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0