What Editor is best to use ?

Helpful tips and guides, also new users can ask for help here.
Andrew
ROM Dongle
Posts: 25
Joined: Tue Jul 17, 2018 9:10 pm

Re: What Editor is best to use ?

Postby Andrew » Wed Aug 08, 2018 6:15 pm

janbredenbeek wrote:I've not been able to reproduce the problem on Qemulator. What kind of medium was win3_ mapped to (Windows directory or MDV/WIN file)? Was it perhaps read-only?

Jan.

The file that I was trying to load was always in a drive mapped to a Directory - and for sure not read-only. I can read and write to that file and directory from SuperBasic, Zip, ED etc.
i tested with QED in a drive mapped to a zip file and to a drive mapped to a directory - there was no difference.
I also performed the test using my boot file (which loads PE, Mouse, Turbo Toolkit, Dj Toolkit) - and also without any boot file, so QED was the only loaded program. Once again, there was no difference.

Derek_Stewart wrote:When you say the drives are mapped correctly, can you show the drive mapping or maybe upload the Q-Emulator config file here so that we can see what you have setup.

I use QEmulator for Windows (registered) - on Windows 10
This is QEmulator's config

Code: Select all

Ram=3M
MainRom=.\QL ROMs\min198_qem_rom
BackRom=.\QL ROMs\TK2_rom
BackRomActive=Yes
ExpRom=
ExpRomActive=No
UseFloppyName=Yes
FloppyName=Flp
UseHardDiskName=Yes
HardDiskName=Win
HasRamDisk=Yes
RamDiskName=Ram
HasParPort=Yes
ParPortName=Par
TCP=On
Subdirs=On
Speed=Full
FastStartup=Yes
AutoStartSession=Yes
FirstKey=None
DisplayMode=Window
AcceleratedGraphics=Yes
Sound=On
SampledSound=On
Joystick1=None
SER1=Printer
SER2=Printer
SER3=None
SER4=None
Slot1=x:\QL Software\Win1
Slot2=x:\QL Software\Learn
Slot3=Empty
Slot4=Empty
Slot5=Empty
Slot6=Empty
Slot7=Empty
Slot8=Empty


RWAP
RWAP Master
Posts: 2489
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: What Editor is best to use ?

Postby RWAP » Thu Aug 09, 2018 8:08 am

I was intrigued by this and have replicated the issue...

If you use the downloadeded zip from Dilwyn's site (1.02), and then enter:

Code: Select all

EXEC flp1_QED;'flp2_QLTest_bas'


The program creates a new file called "flp2_flp2_QLTest_bas" rather than opening the existing flp2_QLTest_bas.

The issue is that the file parameter does not spot that a device name has been passed to the program.

If you start the program with

Code: Select all

EXEC flp1_QED


and use the main screen to enter the filename as flp2_QLTest2_bas, then a new file called QLTest2_bas on flp2_ is created.

However, if you do this and enter the filename on the main screen as flp2_QLTest2_bas, then the existing file is NOT opened - a new file is created. Adding some text and exit the program with <F3> x and a new file is actually created flp2_flp2_QLTest2_bas

All of these problems disappear if you do not pass a device as part of the filename and allow QED to default to flp2_

Unfortunately, the config_bas program does not allow you to change that default device for files either...


Andrew
ROM Dongle
Posts: 25
Joined: Tue Jul 17, 2018 9:10 pm

Re: What Editor is best to use ?

Postby Andrew » Thu Aug 09, 2018 11:30 am

Thank you Rich, this makes the issue clear! Tonight I will test the latest version of QED - QED in flp1_ and the file to be edited in flp2_

@janbredenbeek : Could please fix the issue ? Or fix the config program to work on QDOS. Thank you.


User avatar
janbredenbeek
Gold Card
Posts: 265
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: What Editor is best to use ?

Postby janbredenbeek » Thu Aug 09, 2018 1:30 pm

RWAP wrote:I was intrigued by this and have replicated the issue...

If you use the downloadeded zip from Dilwyn's site (1.02), and then enter:

Code: Select all

EXEC flp1_QED;'flp2_QLTest_bas'


The program creates a new file called "flp2_flp2_QLTest_bas" rather than opening the existing flp2_QLTest_bas.

The issue is that the file parameter does not spot that a device name has been passed to the program.

Still not able to reproduce the problem with either 1.02c from Dilwyn's site or v2.00b2. If a TK2 default directory (in your case flp2_) has been prepended it means QED cannot find the device by opening a directory channel to it. The relevant logic in S*BASIC is:

Code: Select all

dirchan=FOP_DIR(filename$)
IF dirchan >= 0 THEN
  CLOSE#dirchan: REMark directory device exists so close directory again
  chan=FOP_IN(filename$): REMark try opening file itself
ELSE
  filename$=DATAD$&filename$: REMark prepend TK2 default data directory
  chan=FOP_IN(filename$): REMark Try again with TK2 default directory
ENDIF
REMark Now test if chan has been successfully opened
IF chan >=0 THEN
  load_file_into_QED
ELSE
  start_editing_a_new_file
ENDIF

(If you're interested in the actual assembler code, it's in QED2.ASM from line 618 in the v2_working branch on GitHub).
If you start the program with

Code: Select all

EXEC flp1_QED


and use the main screen to enter the filename as flp2_QLTest2_bas, then a new file called QLTest2_bas on flp2_ is created.

However, if you do this and enter the filename on the main screen as flp2_QLTest2_bas, then the existing file is NOT opened - a new file is created. Adding some text and exit the program with <F3> x and a new file is actually created flp2_flp2_QLTest2_bas

All of these problems disappear if you do not pass a device as part of the filename and allow QED to default to flp2_

QED v1.02 and later support the TK2 default data directory; you only have to enter a file name if the file you want to edit or create is in the TK2 default data directory. So if you enter 'boot' as filename and DATAD$ is 'flp2_' then QED either loads or creates flp2_boot. Of course if you would enter 'flp2_boot' then it should not prepend another 'flp2_' in front of 'flp2_boot' and to determine if it should, it tries to open a directory using the supplied filename; if this succeeds then it leaves the name alone. My guess is that this somehow goes wrong. Could you please try this on your machine:

Code: Select all

OPEN_DIR#4;flp2_QLtest_bas (or any file on flp2_)
CLOSE#4

and tell which error message you get on OPEN_DIR. If you do get an error, this means that either the device doesn't exist or the driver returns an error when trying to open a directory on the device using the device name plus given file name. The latter behaviour is definitely non-standard as an OPEN_DIR should always succeed if the device exists and its directory is readable - else it would be hard to implement subdirectory support in commands like DIR etc (try DIR flp2_QLtest for example, it should print at least QLtest_bas if it exists and not produce an error).

Like I said, I haven't been able to reproduce the problem in Qemulator (I just tested on SMSQmulator and QED still behaved as intended) but will check again when I'm back at home this evening...

Jan.


RWAP
RWAP Master
Posts: 2489
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: What Editor is best to use ?

Postby RWAP » Thu Aug 09, 2018 1:54 pm

janbredenbeek wrote:QED v1.02 and later support the TK2 default data directory; you only have to enter a file name if the file you want to edit or create is in the TK2 default data directory. So if you enter 'boot' as filename and DATAD$ is 'flp2_' then QED either loads or creates flp2_boot. Of course if you would enter 'flp2_boot' then it should not prepend another 'flp2_' in front of 'flp2_boot' and to determine if it should, it tries to open a directory using the supplied filename; if this succeeds then it leaves the name alone. My guess is that this somehow goes wrong. Could you please try this on your machine:

Code: Select all

OPEN_DIR#4;flp2_QLtest_bas (or any file on flp2_)
CLOSE#4

and tell which error message you get on OPEN_DIR. If you do get an error, this means that either the device doesn't exist or the driver returns an error when trying to open a directory on the device using the device name plus given file name. The latter behaviour is definitely non-standard as an OPEN_DIR should always succeed if the device exists and its directory is readable - else it would be hard to implement subdirectory support in commands like DIR etc (try DIR flp2_QLtest for example, it should print at least QLtest_bas if it exists and not produce an error).

Like I said, I haven't been able to reproduce the problem in Qemulator (I just tested on SMSQmulator and QED still behaved as intended) but will check again when I'm back at home this evening...



I am use q-emulator v3.2 on Windows with JS ROM and Toolkit II ROM 2.12. No other custom settings. FLP1_ and FLP2_ are pointing to standard Windows folders on my hard disk.

PRINT DATAD$ returns mdv2_

Code: Select all

OPEN_DIR#4;flp2_QLtest_bas (or any file on flp2_)


Gives bad parameter, so I guess that is the issue.

I agree, this is not expected behaviour - certainly, when I wrote the SBASIC / SuperBASIC Reference Manual, on a standard QL, the above line should be exactly the same as

Code: Select all

OPEN_DIR #4,flp2_


See Note 6 (http://superbasic-manual.readthedocs.io ... l#open-dir)

Perhaps this is a bug in q-emulator - what version are you using ?


Andrew
ROM Dongle
Posts: 25
Joined: Tue Jul 17, 2018 9:10 pm

Re: What Editor is best to use ?

Postby Andrew » Thu Aug 09, 2018 6:44 pm

I noticed the following:
OPEN_DIR#4,flp2_QLtest_bas
will return:
- Bad Parameter - if QLtest_bas exists on flp2_
- no error - if QLtest_bas does not exist on flp2_

Also make_dir does not work on QEmulator - it returns Bad name


RWAP
RWAP Master
Posts: 2489
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: What Editor is best to use ?

Postby RWAP » Thu Aug 09, 2018 7:06 pm

Andrew wrote:I noticed the following:
OPEN_DIR#4,flp2_QLtest_bas
will return:
- Bad Parameter - if QLtest_bas exists on flp2_
- no error - if QLtest_bas does not exist on flp2_

Also make_dir does not work on QEmulator - it returns Bad name


That is correct - but not expected behaviour.

MAKE_DIR is not a Toolkit II command as such - it is a level 2 drivers command (which are not present in q-emulator).


Andrew
ROM Dongle
Posts: 25
Joined: Tue Jul 17, 2018 9:10 pm

Re: What Editor is best to use ?

Postby Andrew » Thu Aug 09, 2018 7:43 pm

Rich, I wish your SuperBasic manual had filtering capabilities, to filter all keywords from a specific toolkit (location, as it is named in the manual)
:D


RWAP
RWAP Master
Posts: 2489
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: What Editor is best to use ?

Postby RWAP » Thu Aug 09, 2018 7:55 pm

Well it is a community project so anyone can contribute to add this feature :)


Ralf R.
ROM Dongle
Posts: 5
Joined: Fri Jun 15, 2018 8:58 pm

Re: What Editor is best to use ?

Postby Ralf R. » Thu Aug 09, 2018 8:34 pm

Andrew wrote:All of these problems disappear if you do not pass a device as part of the filename and allow QED to default to flp2_

Unfortunately, the config_bas program does not allow you to change that default device for files either...


I can't understand this problem. In S_Edit, I set SV_DDLST to "" to not let TK2 use its default directory. The only way to do so, to examine, if a file name really exists and to prevent TK2 to rush its default directory in front of a filename. So, things like "win1_flp2_test_asm" are not possible. That's the most bad behavier of TK2 (in my opinion).

At least, if the filename isn't found, I set SV_DDLST to its original value and try again. If that isn't found, it is a new file.

What is easier?
Last edited by Ralf R. on Thu Aug 09, 2018 8:53 pm, edited 1 time in total.



Return to “Help for New Users”

Who is online

Users browsing this forum: kmmann and 1 guest