I think i did not be explicit enough. i want to run a VB statements from a variable and not a Ms-dos command line
commandinput$ = "For i = 1 to 3 : next"
execute commandline
Or to load a sub or fonction previously saved on disk?
any idea?
SkyFighter
I'm trying to get the user input a line of code and then execute it. I want it to look like this:
Private Sub inputbox_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then commandline$ = inputbox.Text
End Sub
Private Sub Command1_Click()
commandline$ 'execute the command
End Sub
or there is a...
i want to ask the user for a command that vb can execute and didn't find a way to do it. i want to do something like:
Let InputCommand$ = "For I = 1 to 10 : next I"
InputCommand$ 'execute command line
Or there is a way to create a file that VB can use to input command ?
SkyFighter
Don't know exactly what you're trying to do, but if you want to put control code into a text file this is easy done.
For Exemple:
Private Sub Form_Load()
Open "textfile.txt" For Output As #1
controlcode$ = Chr$(6) + Chr$(8) + Chr$(7)
Print #1, controlcode$
Close #1
End Sub...
I tried your code with windows 98 and format.com doesnt have the /FS parameter. it worked correctly otherwise. with windows XP i don't know if the SHELL command is working differently but you may try to use SHELL with a single string like this:
CLS
INPUT "Which drive do you want to format "...
i was wondering how i can manage to turn the caps lock on at windows start-up. i looked into the api viewer and did only find this:
Private Const CAPSLOCK_ON = &H80
someone have any ideas?
SkyFighter
skyfighta@hotmail.com
Get the fun out of life!
This is how you can simply write to a file.
set userscreen$ to the user name to save
set userscreen$ to the user pass to save
This will simply add the new user and pass to the file:
Open "password.dat" For Output As #1
Print #1, userscreen$
Print #1, userpass$
Close #1
To load previously...
I don't know why you would use GOSUB instead of processing all the items into 1 select statement. As trollacious said, GOSUB are not used anymore, it is only left out for compatibility, since you can do better with SELECT and SUB statements, and it takes more memory than needed for something you...
I don't know the code to use with the onkey funtion but maybe this could help
***** P = down, H = up, K = left, M = right *****^
k$ = INKEY$
If k$ = Chr$(0) + "M" Then
rem right Arrow
rem ...
end if
If k$ = Chr$(0) + "K" Then
rem left arrow
rem ...
end if
If k$ = Chr$(0) + "H"...
It's easier for a beginner to understant what "LET" let you do, and it can be useful when you want to search your code for variable change and not for comparison, but you're right it takes too much place for something not necessary at all. I used to take "LET" on the TRS80, and it's a good...
If you're using QBasic 4.5 you can easily use the COMMAND$ function, witch return the used command line parameters.
LET VLAN$ = COMMAND$
(remaining code)
...
miguel
migoul@hotmail.com
http://www.geocities.com/siliconvalley/network/8177
thanx to you logiclrd, but im doing a table of the exponent of a number into a file, so i need to do all the calcul :)
miguel
migoul@hotmail.com
http://www.geocities.com/siliconvalley/network/8177
thanx you really much logiclrd. i would never thought i could reduce my code so drasticly, now it take about the half time it was for calculating! instead of taking me 10 hours to find 13 exp 12000 it will take me about 5.
did i say you thanx? ;)
miguel
migoul@hotmail.com...
i use ltrim$(rtrim$(str$(number))) to get rid of the heading and ending space that str$ is returning, and i wonder if there is not a more efficient way to do this because it take a lot more time cause i'm calculate numbers larger than 10000 characters long and its taking eternity to calculate...
if you do not want other suggestion you will not be able to do what you want to. try using line(upleft)-(downright), color, bf to draw a rectangle the same color as your background.
miguel
migoul@hotmail.com
http://www.geocities.com/siliconvalley/network/8177
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.