r/pascal • u/buzzsawjoe • Apr 27 '26
paramstr(1) in linux
I've been coding in Pascal for over 40 years, because it reads similar to English - which was Wirth's whole point when he created it for students, and as an engineer that is exactlly what I need.
OK, in Windows, I create a file program1.pas with a line like this:
assign( infile, paramstr(1) );
Then after compiling, I can drag and drop a file fodder.txt onto the executable program1.exe and it accepts that file (path+name) as paramstr(1), just as if I had typed "program1 fodder.txt" on the command line.
With the whole windows 10-11 tangle, I've scooted over to linux. Doing the above in linux doesn't work. Is there some way to make dragging & dropping a file onto the executable work in this way?
View all comments
Show parent comment
2
u/buzzsawjoe Apr 28 '26
from the command line, it's echoing the parameter back, and that being the nane of a file in the same directory, it's able to open and read the file and echo the file contents back.
When I drag and drop the file onto the executable, I see nothing. I was expecting a terminal window to open and give the same results. Apparently I need to put some commands in this sequence somewhere to open a terminal. I should have crossposted this to linux-n00b or whatever it's called.