Posts: 5
Threads: 2
Joined: Jul 2003
I have an exe. And I want my program to do 2 things.
#1 Open the exe and edit 2 words from "Mainta" to "Maintx"
#2 Open the exe and edit 2 words from "Maintx" back to "Mainta"
I dont know how to do this. Is there a tutorial that will let me
search for a specific sequence of numbers and or letters and replace them?
If somone can please show me how to do this.
Posts: 3,368
Threads: 195
Joined: Jan 2003
You need to use GET and PUT to look at the whole file as sort of one large string, OR (if it's a TEXT file), use LINE INPUT #1:
http://forum.qbasicnews.com/viewtopic.php?t=3389&
Don't forget the different OPEN modes..(bINARY, OUTPUT, INPUT..)
To search for something:
a$ = "'Welcome to McDonald's!' 'Yes, um.. I'd like a Happy Meal.' 'Do you want fries with that?'"
searchfor$ = "fries"
PRINT INSTR(a$, searchfor$) 'built-in function.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 5
Threads: 2
Joined: Jul 2003
Quote:a$ = "'Welcome to McDonald's!' 'Yes, um.. I'd like a Happy Meal.' 'Do you want fries with that?'"
searchfor$ = "fries"
PRINT INSTR(a$, searchfor$) 'built-in function.
I kinda dont understand you.
Can you explain what is A$ = "..." for ?
What what is searchfor$ = "fires" for.
Posts: 3,368
Threads: 195
Joined: Jan 2003
Run it.
"I dont know how to do this. Is there a tutorial that will let me
search for a specific sequence of numbers and or letters and replace them?
If somone can please show me how to do this"
searchfor$ is what you search for, and a$ is what is searched.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.