Closed robhagemans closed 6 years ago
Hi Joe,
Thanks for your interest - to be able to help, I need a bit more information:
PCBASIC.INI
file so I can see what changes you made?Thanks Rob
I use a program I wrote back in the 80s for my monthly church auction. I need to print invoices both during the sale and of course at the end. I am trying to get the print option to process as soon as a page is completed. I have noted that the control codes I use for my line printer will not work on my newer HP printer I have connected via my local network. The following program is what I am using to test the function of the option.
10 PRINT"This program will try to print 3 pages of numbered lines." 20 FOR X = 1 TO 3 30 FOR Y = 1 TO 55 40 LPRINT "page "X" line "Y 50 NEXT Y 60 NEXT X 70 PRINT"done" This is the INI file in my roaming DIR. I note that when I open the location of PC-BASIC, it shows \local\ rather than roaming.
[pcbasic] print-trigger=page run=auction.txt
Note, you probably know, all the large bold print lines are preceded by a hash-tag (#)
Does the run=auction.txt
option work? I.e. when you start PC-BASIC, does it automatically run the program? I'm trying to determine whether it can actually find the INI file.
Another thing - what happens if you add this:
55 LPRINT CHR$(12)
No, it does not run my auction.txt program. The CHR$(12) is used in my Auction program, but it only results in a small heart shaped character being printed and then the data for the next page begins. I can work around that by keeping track of the lines printed.
It seems maybe the INI
file is not found at all. What is the full path of the INI
file on your computer?
I tried copying the INI file to the appdata\local dir, then to appdata\local\pcbasic and finally to appdata\local\pcbasic\data (where the default file resides), all with the same result
C:\Users\joe\AppData\Roaming\pcbasic is the path
The file you make changes to should be the one in \AppData\Roaming, changing the files in Local or changing the default file won't have an effect. You also do need the CHR$(12)
form-feed character as PC-BASIC does not know how many lines fit on the page - it's the form-feed that should trigger the print.
Can you try starting from the Windows command prompt with the --print-trigger=page
option? That way we can determine whether the issue is with the INI
file or with the option.
I have had a problem starting pcbasic from the command prompt. I'll try again, but if you could tell me if I need to put a path name before pcbasic, that might help.
I tried starting it from c:\users\joe and get the reply pcbasic is not recognized as an internal or external command...
Finally, I was able to get somewhere. I used the path c:\users\joe\appdata\local\pc-basic>. When I entered the command pcbasic --print-trigger=page, the screen displayed the window for pcbasic and then collapsed it, reporting "file not found"
If I enter just pcbasic, the same thing happens. ERROR: File not found
OK, apparently it is picking up one of your INI files and trying to run a file that's not there. Try
pcbasic --print-trigger=page --run=
with nothing after the run=
option - that should avoid it trying to run anything
GREAT! That brought up the pcbasic window, but I couldn't load my program. It did not find any of them. I wrote a quick program to test the page print function and it worked! I can move my programs now and try to make a new shortcut to run pcbasic. Are you familiar with the chr that is printed when I issue the CHR$(12) command and is there a way to supress it?
I have to go out for the day. I will check back later. Thanks so much for all your help.
OK, so it seems it works, but PCBASIC doesn't see your INI
file. As a workaround you could of course create a new shortcut or add the options to the existing shortcut.
To identify the issue with the INI
files, I think it would be best to first delete the existing edited ones and to put the default file back in its original state, and then experiment with the file in the AppData\Roaming
location only.
I'm not sure how Windows 10 treats that location as I don't have a Windows 10 machine to try it on. It seems to work OK in Windows 7. However, some versions of Windows make this location hidden, (which is very annoying, since Microsoft actually recommend this as the location for configuration files!). So you may need to unhide it first.
I don't know of a way to suppress a character being printed for CHR$(12)
- it's supposed to be a form-feed control character but not all printers/operatng systems may treat it that way...
Windows 10 will not allow changes to be made to its shortcuts. I found the INI file that I could get pcbasic to load, it was the one I copied to appdata\local\pcbasic. I created a sub-dir Auction, and put my program there. Then changed the options to run from the sub-dir and all seems OK for now. I will run further tests later. Windows 10 hides the appdata dir, but once you open it, you can move through the dir tree just fine. I created a new shortcut to be placed on my desktop. I compared it with the one generated by the download of your pcbasic. I think the problem is that windows 10, in hiding the appdata folder, didn't allow your shortcut to complete properly. The target was the same, but the "Start in" location truncated the path after %user profile%. If someone else runs into this problem, have them check the properties of their shortcut for the "Start in" location. Again, thanks for all the help. I do have an idea that I would like to write my own online/live auction program, but I know GWBASIC is not the way to go there. I had a copy of Basic For Windows from Richard Russel across the pond. but his documentation was a bit to complicated for me to follow. Do you have any suggestions? I did have some success using Russels B4W, but lost my copy when I had a major crash on my home system, just a week after my wife broke her laptop (where I kept my backups)! If you know of a language that is similar to basic, but will access windows applications, let me know.
Hi, thanks for the background. I'm glad it works now. I'll have to check if I can make this more intuitive in Windows 10, but I would need to be able to try it on that OS which is currently not an option.
As for BASIC-like development platforms for Windows, what comes to mind is Microsoft's VB.NET which is freely available as part of .NET - I think Visual Studio Community or whatever they call it now has development tools for it.
Can't reproduce on Windows 10 - the INI fle shortcut is accessible and changes to the file can be saved and are seen by PC-BASIC. The "start in" location is the user home folder, which is OK.
moved from https://github.com/robhagemans/robhagemans.github.io/commit/532e6c3f051024e14ccaf6aa725ffba88fe3ddff#commitcomment-21778772
This is not the place for my comments, but this is the first place I found that might get a response from Rob. Your PC-BASIC looks like it will allow me to continue to use my 35 year old programs. Great! the problem I have is the limit on printing. I cannot get the print-trigger=page option to work. I am using windows 10. I found and made changes to the INI file. Nothing seems to have effect. I went so far as to put the options in the Defailt file, still no change. I m unable to start PCBASIC from my command prompt either. Any Help? I have joined GitHub as BigJoe3, Thanks