However, there are a few things I would like to figure out:
1. To open a file, I get input (for the filename) and save it to a char variable. Then, I use an ifstream to open the variable. That works great. However, I want to make it so when you double click on a .hs file, it will automatically pass the file location to the char variable. When I double click on my .hs file, it opens the program and asks me where the file is. I just want it to bypass that step so you don't have to type that in if you opened the file, but I do want ti to do that if you just run the program. Is there a way to do this?
2. I want to make it so the interpreter completly ignores a line in the file if it beins with // (Comments.) I have it set up so it reads each word in the file, sends it to a huge array, and then a for loop reads the lines and checks to see if it's a command. Ex:
Psuedo code:
- Code: Select all
lines[100000]
open file.txt
read file.txt
send lines to lines[]
for(i=0;i<20;i++){
if(lines[k] == "$dos()"){
dos()
}
etc...
}
How can I make it ignore everythong on the line after the //? I'm not asking for code, maybe a few hints and a links or two.


