Oxygen Basic

Programming => Example Code => Topic started by: Arnold on March 14, 2017, 05:57:57 AM

Title: A little brother of OxIde
Post by: Arnold on March 14, 2017, 05:57:57 AM
Hello,

this is a project I started three weeks ago. It is a single file editor using the SciLexer.dll of OxygenBasic. As the development is in an early stage I only recommend to use it for experimental purpose.

On my first attempt I tried to use the OxIde functions but I found that OxideUtil.inc is too much specific to Oxide and also is developed to be used with OpenGl. So I applied only some functions modified a little bit. Nevertheless the editor is based on OxIde, so I see it as a little brother. As I was inspired by OxIde maybe this project will produce some ideas for OxIde too some day.  Attached is a running executable which should run with Windows Vista and later and the source code for running OxSciPed.o2bas with a Resource dll.

Running the first time OxSicPed.exe will create a config file. Probably the path for Oxygenbasic will not match and must be edited in OxSciPed.cfg. This config file must also be copied into the src folder.

At the moment there are some missing functions e.g. find / findreplace will do nothing, statusbar will need some work, context sensitive help is not yet done. But when these steps are finished it should be possible to develop and extend OxSciPed by itself.

Roland

Edit: Deleted and attached new version with later message

.
Title: Re: A little brother of OxIde
Post by: Aurel on March 14, 2017, 08:27:22 AM
Hi Arnold..
Nice  :)
..but one thing is not clear to me ..
where is scilexer.dll ?  :o
Do you compress editor exe?
Title: Re: A little brother of OxIde
Post by: Arnold on March 14, 2017, 09:09:50 AM
Hi Aurel,

SciLexer.dll is provided with OxygenBasic. If you installed OxygenBasic in d:\Oxygenbasic everything will work ok. Otherwise you have to change in OxSciPed.cfg d:\OxygenBasic to the correct path.

OxSciPed.exe was created from the code in the \src folder, but the resources were linked directly to the created executable. For modifying the source code of OxSciPed I will only need OxSciPed.dll at the moment.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on March 14, 2017, 11:15:40 AM
Yes Arnold
I have Oxygen basic on disk D and many other folders where is scilexer  ;D
but this is little bit unusual way to load scilexer.dll ..right?
Ok everything work fine  :)
Title: Re: A little brother of OxIde
Post by: Arnold on March 14, 2017, 11:55:06 PM
Hi Charles,

I would like to add in the AboutBox of the editor something like this:
You are using OxygenBasic
Version:
(used version)

This would be interesting if I run OxSciPed.exe as an independant executable. Is there a simple way to get the version of the oxygen.dll which will be applied for co2.exe? Could I use Oxygen's compile function in some way?

Roland
Title: Re: A little brother of OxIde
Post by: Arnold on March 15, 2017, 03:09:44 AM
A small bug has slipped into the 'Open' option: a changed text will not be saved. I am about to solve this problem. At the moment one must save a file before opening a new one.

There is also a small mistake in OxSciShortcuts.txt. It must read:
  F5                Run .o2bas file
  F9                Run binary / exe file
                    (will eventually need Oxygen.dll)

There cannot be enough tests for such a kind of application.

Roland
Title: Re: A little brother of OxIde
Post by: Charles Pegge on March 15, 2017, 05:18:33 AM
Thanks Roland,

I'm doing a  bit more work to clean up winutil.inc and transfer specialised messaging down to oxideutil.inc

I have not had a chance to study your OxSciPad yet but I will need to provide you with a new Oxygen.dll call o2_version() as string. The current API for Oxygen.dll can be found in inc/sysutil.inc

I have found that Oxide.exe (it must be in binary form),  will support direct compilation, without requiring gxo2.exe or co2.exe.

This allows greater flexibility for debugging and analytics with oxygen.dll under direct control.

the magic lines are
Code: [Select]
         o2_mode 9 'to use strings insteat of char*
         '
          'DIRECT COMPILING : ONLY WORKS WHEN OXIDE IS COMPILED (NO JIT!)
          o2_basic s
          if not o2_errno then
            o2_exec 0
          else
            print o2_error
          end if
Title: Re: A little brother of OxIde
Post by: Charles Pegge on March 15, 2017, 01:38:53 PM
Unfortunately, it is not safe to use o2_exec in the same process as the IDE, so direct compiling is not feasible for JIT operations, but compiling to a binaries is ok.

Code: [Select]
          'DIRECT COMPILING : ONLY WORKS IN OXIDE.EXE
          if mo then
            o2_basic s 'COMPILE TO BINARY FILE DIRECTLY
            if o2_errno then
              s=o2_error
              print s
              cmsg="" ' "compiling error"
            end if
            SetWindowText hwnd,cmsg
          else 'JIT EXECUTION IN SEPARATE PROCESS
            s="\co2.exe" 'CO2 COMPILING
            's="\gxo2.exe" 'GXO2 COMPILING
            Exec qu+o2dir+s+qu+" "+qu+OxyPath(f)+qu 'RUN COMPILER AS A SEPARATE PROCESS
          end if
Title: Re: A little brother of OxIde
Post by: Arnold on March 16, 2017, 12:26:32 AM
Hi Charles,

I always learn something new with Oxygenbasic. I can use the code above and it would work quite nice but I will either need oxygen.dll in the folder of OxSciPed or add \Oxygenbasic path to the environment or make a copy of OxSciPed.exe in \Oxygenbasic folder. This is what I would like not to do.

On the other hand if I try to #define NoOxygenLib to declare the o2_* statements outside of SysUtil.inc e.g.

librarypath o2dir +"\"

  extern lib "oxygen.dll"
  ! o2_abst      (string s) as string
...

I will get this error when I start the exe file:
o2diroxygen.dll

Could I use loadlibrary / bind instead? But I think I must use unpototyped functions then.

Nevertheless the possibility to use oxygen.dll in an independant executable offers some interesting options. Does a summary exist somewhere about the intended use of the o2_* functions?

Roland
Title: Re: A little brother of OxIde
Post by: Charles Pegge on March 16, 2017, 02:47:46 AM

Hi Roland,

LibraryPath is currently 'baked' at compile time, (or JIT time). You can only use a literal path name.

It is certainly possible to use late-binding techniques for any dll, using LoadLibrary / GetProcAddress etc.
You will find an example in ProjectsC\thinBasicOxygen which has the source code for the thinBasic modular interface.

But your simplest option is to compile the IDE as an oxygen-dependent binary and drop a copy into the OxygenBasic folder. Then create a shortcut for it, should you wish to run it from the desktop, for example.

For an independent system,  as an alternative to the standard OxygenBasic environment, you will need to include oxygen.dll, sciLexer.dll and co2.exe (or gxo2.exe)
Title: Re: A little brother of OxIde
Post by: Arnold on March 16, 2017, 03:29:03 AM
Thank you Charles. I found the ThinBasicOxygen folder and I will study the examples to learn more about the possible usage of Oxygen.dll as an external library.

Roland
Title: Re: A little brother of OxIde
Post by: Charles Pegge on March 16, 2017, 04:39:43 AM
Here is a late binding for oxyen in oxygen, without the complexities of the thinBasic module.

Code: [Select]
#file "LateBinding.exe"
extern
   !* o2_abst      (string s) as string
   !* o2_asmo      (string s) as sys
   !* o2_assemble  (string s) as sys
   !* o2_basic     (string s) as sys
   !* o2_exec      (sys p=0)  as sys
   !* o2_buf       (sys n)    as sys
   !* o2_errno     ()         as sys
   !* o2_error     ()         as string
   !* o2_get       ()         as string
   !* o2_len       ()         as sys
   !* o2_link      ()         as sys
   !* o2_mode      (sys m)
   !* o2_pathcall  (sys m)
   !* o2_prep      (string s) as string
   !* o2_put       (string s)
   !* o2_varcall   (sys m)
  ' !* o2_version   () as string
   !* o2_view      (string s) as string
  end extern

  sys oxl=loadlibrary "oxygen.dll"
  if oxl then
    def link @%1=getprocaddress oxl, "%1"
    '@o2_abst=getprocaddress oxl,"o2_abst"
    link o2_abst
    link o2_asmo
    link o2_assemble
    link o2_basic
    link o2_exec
    link o2_buf
    link o2_errno
    link o2_error
    link o2_get
    link o2_len
    link o2_link
    link o2_mode
    link o2_pathcall
    link o2_prep
    link o2_put
    link o2_varcall
   ' link o2_version
    link o2_view
  end if

  if not oxl then
    print "Cannot locate oxygen.dll"
    end
  end if

  o2_mode 9 'for oxygenBasic ascii strings

  o2_basic "print `helo`"

  if o2_errno then
    print o2_error
  else
    o2_exec
  end if

And a more cautious version with checks for missing Proc Addresses:

Code: [Select]
#file "LateBinding.exe"
extern
   !* o2_abst      (string s) as string
   !* o2_asmo      (string s) as sys
   !* o2_assemble  (string s) as sys
   !* o2_basic     (string s) as sys
   !* o2_exec      (sys p=0)  as sys
   !* o2_buf       (sys n)    as sys
   !* o2_errno     ()         as sys
   !* o2_error     ()         as string
   !* o2_get       ()         as string
   !* o2_len       ()         as sys
   !* o2_link      ()         as sys
   !* o2_mode      (sys m)
   !* o2_pathcall  (sys m)
   !* o2_prep      (string s) as string
   !* o2_put       (string s)
   !* o2_varcall   (sys m)
   !* o2_version   () as string
   !* o2_view      (string s) as string
  end extern

  sys oxl=loadlibrary "oxygen.dll"
  if oxl then
    string errs
    def link
      @%1=getprocaddress oxl, "%1"
      if not @%1 then errs+="%1 is missing"+chr(13,10)
    end def
    '@o2_abst=getprocaddress oxl,"o2_abst"
    link o2_abst
    link o2_asmo
    link o2_assemble
    link o2_basic
    link o2_exec
    link o2_buf
    link o2_errno
    link o2_error
    link o2_get
    link o2_len
    link o2_link
    link o2_mode
    link o2_pathcall
    link o2_prep
    link o2_put
    link o2_varcall
    link o2_version
    link o2_view
  end if

  if not oxl then
    print "Cannot locate oxygen.dll"
    end
  end if

  if errs then
    print errs
    end
  end if

 o2_mode 9 'for oxygenBasic ascii strings

  o2_basic "print `helo`"

  if o2_errno then
    print o2_error
  else
    o2_exec
  end if
Title: Re: A little brother of OxIde
Post by: Arnold on March 16, 2017, 08:27:53 AM
Charles,

this is really fabulous. I used your first example and did these modifications:

'#file "LateBinding.exe"
$ filename "LateBinding1.exe"
#include "$/inc/RTL32.inc"
....

'  sys oxl=loadlibrary "c:\OxygenBasic\oxygen.dll"

  string o2dir="c:\oxygenbasic_241116" 
  sys oxl=loadlibrary o2dir + "\oxygen.dll"
...

  print "Program compiled with version: " version

  o2_mode 9 'for oxygenBasic ascii strings
 
  o2_basic "print `You are using oxygen.dll version:` version"

  if o2_errno then
    print o2_error
  else
    o2_exec
  end if

and I get the expected results. This is exactly what I was looking for. I did not yet try to find out, but I assume there is a way to store the value of the second result in a variable?

Roland


.
Title: Re: A little brother of OxIde
Post by: Charles Pegge on March 17, 2017, 07:01:03 AM
Not directly, which is why o2_version will be required.

I will also remove some ancient fossils from the API, and annotate each API function in src\oxygen.bas

These will disappear

o2_assemble
o2_get
o2_put
Title: Re: A little brother of OxIde
Post by: Arnold on March 17, 2017, 12:56:45 PM
This is the intermediate state of my little Oxygenbasic editor. I hopefully fixed the mistake of missing to save a modified textfile before opening a new file. I added an additional bitmap in the toolbar for closing a textfile. Also added some messages in the statusbar for Row/Col and INS(sert) / OVR(type).

Unfortuately the Find and Find/Replace dialog with Scintilla is a bit more complicated than I expected and will be a bit delayed.

Roland

Edit: Deleted and attached new version with later message
Title: Re: A little brother of OxIde
Post by: Arnold on March 24, 2017, 04:24:00 AM
Hi Charles,

it seems that I am almost able to improve and extend the little editor by itself. I added some more features: displaying whitespace and eol, changing eol, set Highlight on/off, a little better F1 help. Find dialog seems to work, Find and Replace is in work.

I would like to use a different name for the editor. OxSciPed is a kind of joke, I just looked for a word which I did not find in Internet. My first choice was LazyPad but this is not quite correct. Although I spied many websites, there is still some work to put everything together. My purpose for this project is to learn more about Scintilla / Scilexer and how to use this with OxygenBasic.

What name could I use? OSPad (Oxygen/Syntilla), OxPed or something else which is meaningful? I have no idea.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on March 24, 2017, 09:47:55 PM
Quote
Unfortuately the Find and Find/Replace dialog with Scintilla is a bit more complicated than I expected and will be a bit delayed.
hi Arnold ..
no..is not to much complex..i have it in OxyEdit ,,but OxyEdit isnot written in Oxygen basic
than in Emergence Basic.
I also made mistake when i use Dialog what complicate things
easier solution will be to use TOOLWINDOW as ALLWAYS_ONTOP style.

ok here is subroutine in EBasic ,,i think that you can translate this to Oxygen
Code: [Select]
SUB FindDialogProc
INT loc
SELECT @class
 CASE @idinitdialog
  SetWindowPos(findDialog.hWnd,-1,0,0,0,0,0x1 | 0x2) /*HWND_TOPMOST=-1,SWP_NOSIZE | SWP_NOMOVE*/
  CENTERWINDOW findDialog
  '__TooltipControl(findDialog,5,"Finds the next instance of string")
  '__TooltipControl(findDialog,6,"Replaces matching string with new string")
  '__TooltipControl(findDialog,7,"Replaces all matching strings with new string")
  SETSTATE findDialog,12,1
  SETFOCUS findDialog,2
 CASE @idclosewindow
  CLOSEDIALOG findDialog
 CASE @idcontrol
  IF @notifycode=0
   SELECT @controlid
'----------------------------------------------------------
    CASE 5
'MESSAGEBOX 0,"Control","5"
     IF GETSTATE(findDialog,12)
      loc=SENDMESSAGE(w1,SCI_GETSELECTIONEND,0,0,IDC_SCI)
     ELSE
      loc=SENDMESSAGE(w1,SCI_GETSELECTIONSTART,0,0,IDC_SCI)
     ENDIF
     SENDMESSAGE w1,SCI_SETANCHOR,loc,0,IDC_SCI
     SENDMESSAGE w1,SCI_SETCURRENTPOS,loc,0,IDC_SCI
     SENDMESSAGE w1,SCI_SEARCHANCHOR,0,0,IDC_SCI
     temp=SCFIND_REGEXP
     IF GETSTATE(findDialog,16) THEN temp=SCFIND_WHOLEWORD
     IF GETSTATE(findDialog,15) THEN temp|=SCFIND_MATCHCASE
     IF GETSTATE(findDialog,12)
      loc=SENDMESSAGE(w1,SCI_SEARCHNEXT,temp,GETCONTROLTEXT(findDialog,2),IDC_SCI)
     ELSE
      loc=SENDMESSAGE(w1,SCI_SEARCHPREV,temp,GETCONTROLTEXT(findDialog,2),IDC_SCI)
     ENDIF
     IF loc>-1
      SENDMESSAGE w1,SCI_SCROLLCARET,0,0,IDC_SCI
     ELSE
      SHOWWINDOW findDialog,@swhide
      MESSAGEBOX 0,"No matches found","Search"
      SHOWWINDOW findDialog,@swrestore
     ENDIF
'-------------------------------------------------------------------
    CASE 6
     SENDMESSAGE(w1,SCI_REPLACESEL,0,GETCONTROLTEXT(findDialog,4),IDC_SCI)
'-------------------------------------------------------------------
'------------------------------------------------------
    CASE 12 : CASE& 13
     SETSTATE findDialog,12,(@controlid=12)
     SETSTATE findDialog,13,(@controlid=13)
     ENABLECONTROL findDialog,16,GETSTATE(findDialog,12)
   ENDSELECT
  ENDIF
ENDSELECT
RETURN
ENDSUB
Title: Re: A little brother of OxIde
Post by: Arnold on March 25, 2017, 01:42:14 AM
Hi Aurel,

thank you for the code snippet. I will explore it. At the moment I use a combination of two other examples which seem to work but I am not quite satisfied with the Replace All functionality. Yet I noticed that there are several possibilities using the Scintilla control. Maybe I can use the replace functions of OxIde in some way. For now the dialogs should work.

I hopefully will be ready until tomorrow to upload a compilation of the code at it's present stage. My problem is still to find a meaningful name. Maybe I will use OSPed.

Roland
Title: Re: A little brother of OxIde
Post by: Charles Pegge on March 25, 2017, 10:31:40 AM
Hi Roland, a few names to contemplate:


oxpad
oxypad
minoxide
oxscite
oxscide
oxcoder
oxgen
--
minide
mincoder
codepad

Title: Re: A little brother of OxIde
Post by: Aurel on March 25, 2017, 11:15:47 AM
WOW
Insteresting names Charles  :D
anyway ...i figured that i dont have this in AurelEdit (ASciO2)...
so i do sme investigation how to do that ..
and i figured that if i wish to use toolwindow as Find/Replace form i must use
window extended style:..then work ..
more mumbo jumbo comming soon.. :D

.
Title: Re: A little brother of OxIde
Post by: Arnold on March 26, 2017, 11:24:04 AM
Hi Charles,

thank you for your suggestions. This issue indeed caused me quite a headache. I see the project as a simple editor example which should be usable with OxygenBasic applying Scintilla and pure WinApi functions. Another goal will be to learn more about Scintilla and SciLexer.dll. Finally I decided on O2HEdit. The project in it's current stage will be attached with my next message.

Roland
Title: Re: A little brother of OxIde
Post by: Arnold on March 26, 2017, 11:34:55 AM
Hello,

attached is the editor project with all sources to build either a resource dll or to build a standalone application.

The original code of O2HEdit.o2bas will need a resource.dll. To create the dll the file \src\MakeDll\MakeDll.bat must be executed. If the path of OxygenBasic is different then in the batchfile the line:
set o2_dir=c:\OxygenBasic
must be changed to the correct path.

To create a standalone executable the two lines in the beginning of O2HEdit.o2bas must be changed to read like this:
...
'#define use_dll
#define make_exe
...
and the file must be saved.

In the file \src\MakeExe\MakeExe.bat the path of OxygenBasic must be perhaps changed too. After executing the batch file a standalone executable will be created.

There are more combinations possible. Everything should also work within O2HEdit. I am curious if there are any difficulties to use O2HEdit.

At the moment there are at least two problems which must be checked:
Opening the find/replace dialogs I do not manage to get focus on the Edit fields. I do not yet know what is missing. Replace All in very long text files will take too much time.
There is also a problem with ctrl chars like ctrl-b, ctrl-w etc which I cannot hide at the moment without loosing the view of the EOL chars. I know it must be possible but I have not yet found out how this will work.

The next steps will be to work out the Settings Menuitem. Then the code must be tightened a little bit.

Then SciLexer will say hello.

Roland

Edit: Deleted and attached new version with later message
Title: Re: A little brother of OxIde
Post by: Aurel on March 28, 2017, 02:04:16 PM
ok Arnold
scilexer i used 1.6.8.0 work with O2HEdit even syntax is highlited is ok
well not exactlly like i have in AurelEdit but that is probably because you use newer version,
I dont try yet version  which comes with Oxygen zip but i will .
Probably require some setting with  using different base lexer not 40 i used in  AurelEdit.
But after  config i also cannot compile with O2Hdit..why?
Second when resizing scintilla flickering ,maybe because Dialog box?   
Title: Re: A little brother of OxIde
Post by: Arnold on March 29, 2017, 12:32:10 AM
Hi Charles,

in the meantime I found out how to set focus in the Find/Replace dialogs. I had to move the ids and index of the edit fields in the .rc file to the start of the dialogs (simple solution).

Can you help out with this problem? For calling F1 help I use the HtmlHelp function of hhctrl.ocx library and a code snippet of OxIde. This works in some way but I assume I missed something important. This is the code in O2HEdit.o2bas file:

Code: OxygenBasic
  1.         case IDM_HELP_OXYGEN
  2.            zstring wd
  3.            sys st,en,le,lw
  4.            s=GetText hSci
  5.            le=len s
  6.            SendMessage hSci,EM_GETSEL,@st,@en
  7.            if asc(s,st) > 32 then      
  8.              st++ : en++
  9.              wd=ExtractWord s,st,en,lw
  10.              HtmlHelp null ,o2dir+"\inf\oxygen_help.chm", HH_DISPLAY_INDEX, @wd
  11.            else
  12.              HtmlHelp null, o2dir+"\inf\oxygen_help.chm", HH_DISPLAY_TOC, 0
  13.            end if        
  14.  

If I move the cursor to a word and press F1, Oxygen_help will show the index with the word. But if I select the whole word then only the TOC is displayed. Can you point me to the right direction?

At the moment I experiment a little bit with the HH_AKLINK structure. I want to display the info of the keyword directly.

Roland

.
Title: Re: A little brother of OxIde
Post by: Arnold on March 29, 2017, 12:57:04 AM
Hi Aurel,

the editor expects all files in the folder/subfolders of \Oxygenbasic:

co2.exe: \OxygenBasic\
oxygen.dll: \OxygenBasic\
scilexer.dll: \OxygenBasic\
gorc.exe: \OxygenBasic\tools\
linkRes2exe.exe: \OxygenBasic\tools\
Oxygen_help.chm: \OxygenBasic\inf\
and of course Oxygen's include files in \OxygenBasic\inc\

If you use another structure then you are at your own at the moment, because I have not yet worked out the Settings option.

Setting the styles and extended styles is indeed a problem and must be checked. I intend to explore this issue if I have added and tested some more features for the editor. Maybe I can get some hints in the meantime?

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on March 29, 2017, 07:10:00 AM
Hi Arnold
It is not problem in folder structure
then in your command line :
ShellExecute (null,"open", compiler, "-c " & openFile, null, SW_SHOW)
what exactly is compiler - is that full path to compiler or just compiler name?
also argument "-c " not work on my both computers and this one work "-c"
..and you not answer me why sci control flickering when is resizing?
 :)
Title: Re: A little brother of OxIde
Post by: Arnold on March 29, 2017, 08:44:41 AM
Hi Aurel,

I think the ShellExecute statements work (at least for me).
It depends on what you want to do.

1) Run a .o2bas file in JIT mode: use MenuItem: Compile, Run .o2bas file or press F5 or use the Tool button "!".
2) Compile a .o2bas file to a binary: MenuItem: Compile, Compile to Binary. Will need eventually oxygen.dll
The ShellExecute which you refer to is for this MenuItem. You can check what it does by including these statements:

Code: OxygenBasic
  1.            'Compile source code
  2.           SendMessage(hStatus, SB_SETTEXT, 3, " Compiling " openFile " with " & compiler " to binary")
  3.            if not exist compiler then mbox compiler " does not exist" : exit function
  4. print compiler
  5. print openfile
  6.            ShellExecute (null,"open", compiler, "-c " & openFile, null, SW_SHOW)
  7.  

If you want to compile to an independent exe file you must use the first option (e.g. F5) and include something like this in your code:

$filename "MyFilename.exe"
#include "$\inc\RTL32.inc"

If you want to use the second MenuItem (compile to binary) you can do this also but you will need the include statement for RTL32.inc too, if you do not want to use Oxygen.dll for running the created exe file.

Referring the flickering: I am waiting for some hints?

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on March 29, 2017, 11:17:04 AM
Hi Arnold
I am asking you about compiler because i dont see what is this from source
is that full path to compiler or is name.
Of course I always do compile to standalone exe ... nothing else.
so that is why I ask.. :)
I am not sure why full path to compiler not work as in some other compilers
but probably Charles have explanation.

Quote
Referring the flickering: I am waiting for some hints?
In fact nothing special ,you must add in main window style WS_CLIPCHILDREN
BUT i am not sure is that work for Dialog form too.
Title: Re: A little brother of OxIde
Post by: Arnold on March 29, 2017, 02:07:16 PM
Hi Aurel,

if the path of your Oxygen is e.g. d:\OxygenBasic (which is kept in O2HEdit.cfg) and you added the two print statements of my last reply in O2HEdit.o2bas in about line 433 then the MenuItem: Compile, Compile to binary should show these results:

D:\OxygenBasic\\co2.exe      (one backslash too much but works nevertheless)
drive:\path\yourProgram.o2bas

So the editor does use the full path of the OxygenBasic compiler. Maybe I should have used compilername instead of compiler, but I thought this would be sufficient.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on March 29, 2017, 10:48:14 PM
Hi Arnold
To clear some things:
Your explanation is ( don't get me wrong)  very  confusing and a way
how you explain not work for me.
If O2HEdit is created as folder in Oxygen Basic folder then O2HEdit.exe not
work properly on my computer.
If O2HEdit.zip is extracted directly into Oxygen Basic  folder then O2HEdit editor work fiine.  :)
Title: Re: A little brother of OxIde
Post by: Arnold on March 29, 2017, 11:59:29 PM
Hi Aurel,

thank you for this hint. This is something which I must test.

I generally let my Oxygenbasic folder untouched. And therefore I use the editor in a seperate directory like e.g. c:\AFolder\ASubFolder\O2HEdit (and the structure of the zip file). Therefore in O2Hedit.cfg the name of the Oxygenbasic directory must be recorded, so that the editor will find Oxygenbasic's tools.

But I can see that this is done with other editors for other programming languages too. They use .ini files or you are forced to add a path in your environment or they do something with the registry.

BTW I reflected on the process of compiling/running programs and now in the statusbar a notification will be shown when a program will be started or compiled. I think this should be helpful.

Roland
Title: Re: A little brother of OxIde
Post by: Arnold on March 30, 2017, 01:22:46 PM
Hi Charles,

I found my little bug in the IDM_HELP_OXYGEN case. (st++ : en++ must be set before the if statement).
In the meantime I also managed to display the help info for the keyword, at least for 90% (I think). The Help Window will only be opened once per instance. I am quite happy with the Help functionality now.

In the meantime I have added some more options to the editor: create an oxygen.cfg in a directory, open an explorer window, add notification in the statusbar when running or compiling a program.

At the moment I try Aurel's idea to start the editor in the OxygenBasic folder and what must be done to create the O2HEdit.cfg file. To be honest: two years ago I would have thought in no way that I could come so far. And OxygenBasic is really very helpful for me.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on March 30, 2017, 02:21:39 PM
Quote
At the moment I try Aurel's idea to start the editor in the OxygenBasic

Arnold
This is not just IDEA ..it is the only way i can compile program with O2Hedit.
so i don't know why only work if is inside Oxygen root folder.
Same problem I have with AurelEDit.
I simply cannot force gxo2 to compile something if Editor is in another folder
WHY ,i don't know.. maybe we can ask Charles?
Title: Re: A little brother of OxIde
Post by: Arnold on March 30, 2017, 11:56:29 PM
Hi Aurel,

O2hEdit 'must' work outside of OxygenBasic. Did you try to delete O2HEdit.cfg and start the editor? If the editor does not find co2.exe a dialog must start for selecting Oxygenbasic's directory to open co2.exe.
Only co2.exe can be used at the moment with the little editor project, but gxo2.exe does almost the same. And I can call these programs from outside of OxygenBasic's directory too. Although I use PSPad most of the time I know (because I tried it) that this works with other editors also e.g. with Scite, Context, Jfe (Jen's file editor). Therefore it must be possible for AurelEdit too. I assume something is missing in the Shellexecute statements. Maybe you can point me to the lines of AurelEdit where you call the routines of Compile and Run?

Roland

.
Title: Re: A little brother of OxIde
Post by: Aurel on April 01, 2017, 05:34:06 AM
Hi Arnold
It is easy to see ..
just look in subroutine doCompile()
but i doubt that problem is in filename because it contain full path to file.
problematic part is path of gxo2.exe path
Title: Re: A little brother of OxIde
Post by: Arnold on April 01, 2017, 03:11:01 PM
Hi Aurel,

if Oxygenbasic is e.g. in c:\oxygenbasic then there are three possibilities in about line 800:

1) using fullpath:
sRet = ShellExecute 0,"open","c:\oxygenbasic\gxo2.exe","-c "+ fn,"",5
2) if a path is added in the environment e.g. via User account control:
sRet = ShellExecute 0,"open","gxo2.exe","-c "+ fn,"",5
3) I copied Aureledit.o2bas and the necessary files into folder projectsB\Scintilla and then I could also use:
sRet = ShellExecute 0,"open","..\..\gxo2.exe","-c "+ fn,"",5

But this is also documented in Win32 Help with the function ShellExecute. You will need either a fullpath or a file which is in the environment path or is in the current directory. The third example uses a relative path to the current (working) directory.

See also the remarks in this link:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx)

Roland
Title: Re: A little brother of OxIde
Post by: Arnold on April 03, 2017, 05:59:55 AM
Hello,

this is an updated version of O2HEdit. F1 should work like in most other editors. The Find/Replace dialog should now work better. I limited the Replace All functionality to 5000 items, the dialog can be continued with pressing Replace All again. I tried this with a file of 78000 lines, it worked quite nice.

Also added is the option to drag/drop a file into the editor. There is the possibility to open an explorer window of the file directory by selecting Tools, Open Explorer. I also added a menuitem for credits.

The editor should start anywhere. If copying into the OxygenBasic folder, it should even start out of the box. When the editor does not find co2.exe it will open a dialog to select the directory of Oxygenbasic and open co2.exe.

The code of O2HEdit.o2bas as is will create an exe file. To link the resources to the executable the batch file MakeExe.bat in folder source/MakeExe must be run.

To run O2HEdit with a resource dll these lines of O2HEdit.o2bas must be changed to:

#define use_dll
'#define make_exe

Before I start to work out MenuItem Options/Settings I have to tighten up the code. There is a lot of redundant code now, but I had to test several cases. There is still more to test.

Roland


.
Title: Re: A little brother of OxIde
Post by: Arnold on April 04, 2017, 01:01:47 AM
Hi Charles,

will it be possible to create the little editor project with Oxygen in progress too or are there some issues to respect? There are two options: creating an exe with the linked resources or creating a resource dll which can be used with the .o2bas file. I would be interested to know if Help would work (you mentioned that you will upgrade Oxygen_help a little bit) and if drag/drop a file would be successful. Somehow a gremlin is there with the .cfg file. Again I discovered a problem if I start O2Hedit with a file in Dos. I thought I already had solved this. The problem arises because I try to start the editor both in JIT mode and also as an independant executable. But hopefully I shall overcome some day.

Would it make sense to add a backup option for a code file? If I want to run a code, it will be first saved and the Undo capabilities are limited. Some editors create a temporary file with a random number and work with this file but I think this is also not completely fool-proof. I would like to use a simple solution.

Roland
Title: Re: A little brother of OxIde
Post by: Charles Pegge on April 04, 2017, 11:25:37 PM
Hi Roland,

Yes your o2hEdit works well on my developing OxygenBasic - A43

The only adjustment needed is to add the child window handle array hchw[...]  in your globals.

I have made quite a few alterations to Winutil (more generic), and sysutil ( includes stringutil and parseutil ).

Re Backup files:

They can get quite messy when working on multiple (include) files. A project could be zipped explicitly by the user, then selected files could be rolled back, if required. I do this regularly with the O2basic source, and find it very useful when making major alterations, and avoiding unforseen disasters.

To execute a program, you can save to a temporary file, and run that file, before commiting the original file to disk.

Re Keyword-specific Help

Passing keywords to Oxygen_Help.chm

The invocation I use is:

        wd=ExtractWord s,st,en,lw
        cm="hh.exe "+o2dir+"\inf\oxygen_help.chm::/wordlink.htm#"+wd
        Exec cm

Title: Re: A little brother of OxIde
Post by: Arnold on April 05, 2017, 12:41:29 AM
Hi Charles,

thank you for testing the compatibility. There is a small bug in O2HEdit.inc and ResourceIds.inc with IDC_FINDREGEX. The lines should read:
#define IDC_FINDMATCHWORD 1155
#define IDC_FINDREGEX 1156

As the project is intended to be a single file editor I removed the connection to hchw at the moment and use only hSci as handle for the Scintilla control. I also used Oxygen's macro capability and replaced all 'SendMessage hSci,' with 'hSciMsg'. I would like to use some more macros. At the moment I try to integrate some repetitive code. Then I will work out the Settings item.

When I started the project I also used hh.exe. The problem with hh.exe is that each F1 will open a new instance of Oxygen_help. Then I noticed that I can use the HtmlHelp Api directly:

! HtmlHelp lib "hhctrl.ocx" alias "HtmlHelpA" (dword hwndCaller, char* pszFile, dword uCommand, dword dwData) as sys

This way I can treat the HH_ commands and HH_ structures more flexible. I have not yet found out all possibilities, in particular wordlink.htm would be interesting to add. Repetitive F1 key would still open a second help file but only if a new instance of the editor is created. Maybe this can be prevented also, but I have not yet found out how this should be handled.
 
Thank you for the hint to create a temporary file for running/compiling the code. I think this is a good and also simple solution and I will try this.

Roland
Title: Re: A little brother of OxIde
Post by: Arnold on April 05, 2017, 01:39:37 AM
While I spied at Windows Dev Center I found this:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms670084(v=vs.85).aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/ms670084(v=vs.85).aspx)

I tried this with O2HEdit and modified the IDM_HELP_OXYGEN case:
Code: OxygenBasic
  1.         case IDM_HELP_OXYGEN
  2.         zstring wd
  3.         sys st,en,le,lw
  4.  
  5.         s=GetText hSci
  6.         le=len s
  7.         SendMessage hSci,EM_GETSEL,@st,@en
  8.         st++ : en++
  9.         if asc(s,st) > 32 then
  10.           if en != st then
  11.             lw=en-st
  12.             wd=mid(s, st,lw)
  13.           else        
  14.             wd=ExtractWord s,st,en,lw
  15.           end if                        
  16.           HtmlHelp null ,o2dir+"\inf\oxygen_help.chm", HH_DISPLAY_INDEX, @wd
  17.           HH_AKLINK link
  18.           link.cbStruct = sizeof(HH_AKLINK)
  19.           link.pszKeywords = wd
  20.           link.fIndexOnFail = true
  21.           HtmlHelp null ,o2dir+"\inf\oxygen_help.chm", HH_KEYWORD_LOOKUP, @link                  
  22.         else
  23.           HtmlHelp null ,o2dir+"\inf\oxygen_help.chm::/wordlink.htm>!", HH_DISPLAY_TOPIC, null        
  24. ''          HtmlHelp null, o2dir+"\inf\oxygen_help.chm", HH_DISPLAY_TOC, 0
  25.        end if
  26.  

I think this would look nice too? This would open an additional Help Window, maybe this can be prevented or it must be called as a seperate item.



.
Title: Re: A little brother of OxIde
Post by: Charles Pegge on April 05, 2017, 01:51:21 AM
One further idea for keyword help: going directly to the topic page, instead of wordlink.htm.

You will need this customised HTM filename encoder which embeds ascii symbols like #  % $ in alphanumeric form: (used in recent versions of oxygen_help)

Code: [Select]
        '
        function filenameHTM(string nn) as string
        '=======
        sys a,i
        string s,n
        n=lcase nn
        for i=1 to len(n)
         a=asc(n,i)
         if a<97 or a>122 then
           s+="a"+str(a-31) 'supports ascii symbol encoding (space=a1)
          else
            s+=chr(a)
          end if
        next
        return s+".htm"
        end function

then you can get to the relevant page directly.
        '
        wd=ExtractWord s,st,en,lw
        'cm="hh.exe "+o2dir+"\inf\oxygen_help.chm::/wordlink.htm#"+wd
        '
        wd=filenameHTM(wd)
        cm="hh.exe "+o2dir+"\inf\oxygen_help.chm::/"+wd
        Exec cm

It should also work with the CHM API


.
Title: Re: A little brother of OxIde - Scintilla.inc
Post by: Arnold on April 09, 2017, 11:58:36 PM
Hi Charles,

I think something is missing with the SCNotification structure in Scintilla.inc? If I use it as is then the WM_NOTIFY messages in my little editor project will not fire. There must be a conflict with the nmhdr structure of minwin.inc. You can test this in OxHEdit.o2bas:
Code: OxygenBasic
  1.    case WM_NOTIFY
  2.       showToolTips(lParam)
  3.  
  4. '      NMHDR pnmh at lParam
  5. '      select pnmh.code
  6.  
  7.       SCNotification pnmh at lParam
  8. 'will need some work
  9.      select pnmh.NotifyHeader.code
  10.  

For now I have redefined the structure in O2HEditApi.inc:
Code: OxygenBasic
  1. 'redefine SCNotification
  2. typedef nmhdr Sci_NotifyHeader
  3.  
  4. type SCNotification
  5.     Sci_NotifyHeader NotifyHeader
  6.     int position;
  7.     /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
  8.     /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
  9.     /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
  10.     /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
  11.     /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
  12.  
  13.     int ch        /* SCN_CHARADDED, SCN_KEY */
  14.     int modifiers;
  15.     /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
  16.     /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
  17.  
  18.     int modificationType    /* SCN_MODIFIED */
  19.     const char *text
  20.     /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
  21.  
  22.     int length        /* SCN_MODIFIED */
  23.     int linesAdded    /* SCN_MODIFIED */
  24.     int message    /* SCN_MACRORECORD */
  25.     sys wParam     /* SCN_MACRORECORD */
  26.     sys lParam     /* SCN_MACRORECORD */
  27.     int line        /* SCN_MODIFIED */
  28.     int foldLevelNow    /* SCN_MODIFIED */
  29.     int foldLevelPrev    /* SCN_MODIFIED */
  30.     int margin        /* SCN_MARGINCLICK */
  31.     int listType    /* SCN_USERLISTSELECTION */
  32.     int x            /* SCN_DWELLSTART, SCN_DWELLEND */
  33.     int y        /* SCN_DWELLSTART, SCN_DWELLEND */
  34.     int token        /* SCN_MODIFIED with SC_MOD_CONTAINER */
  35.     int annotationLinesAdded    /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
  36.     int updated    /* SCN_UPDATEUI */
  37. end type
  38.  

Applying this modification the WM_NOTIFY messages will work. But maybe I missed something with the structure in Scintilla.inc?

Roland
Title: Re: A little brother of OxIde - Update
Post by: Arnold on April 20, 2017, 12:52:10 AM
Hello,

attached is an updated state of my little editor project. It will hopefully not be the last update. I do not expect that anybody will use the editor for real work at the moment. It should work well though for running the examples of OxygenBasic. As I am now able to create O2Hedit.exe by itself and modify the code I will use the editor for extending it a little bit more.

Some things I added (but still must be tested):
Apply SCI_EmptyUndoBuffer instead of SCI_SetSavePoint for stopping Undo. This will hopefully prevent to reload a previous loaded file.

Regular expressions with find (Ctrl-F) and replace (Ctrl-H) using posix mode. The option Replace all with regex seems not to work correctly, I do not yet know if this is an issue of using an older scilexer.dll or a problem of the code.

Sensitive WinApi Help (Ctrl-F1). I used the Win32.chm created by Marc and Mike which can be found at www.oxygenbasic.org, Reference.

When running or compiling a file, a temporary file will be created when the original file is modified and is not yet saved.

There is also a MenuItem Options/Environment Settings, where some directories for used tools can be changed.

Tabs in a file can be replaced by spaces. (I do not like the escaped tabs). The size for tabspaces can be set from 2 to 8.

I also added a basic autoindent and brace matching. Brace matching and editing strings look a little bit weird at the moment.

O2HEdit should run everywhere on disc or usb-stick. If there exists already an o2hedit.cfg file it should be deleted. I also changed the structure of the include files therefore an unused folder would be the best way to extract the files.

The code as it is will create an executable in folder \source. To compile and link to an exe file, the file MakeExe.bat in folder \source\MakeExe must be run (the line: set o2_dir=c:\OxygenBasic must perhaps be changed to the correct path).

To create a O2HEdit.dll, in O2HEdit.o2bas the line 12 must be changed to:
'#define make_exe
MakeDll.bat in folder \source\MakeDll is then used to create the dll in folder \source.

Before I can continue further with the project (fonts), I suppose some issues with Scilexer.dll must be examined.
 
Roland


.
Title: Re: A little brother of OxIde - Next step
Post by: Arnold on May 13, 2017, 02:57:09 AM
Hello,

this is the latest state of my little editor project. There was a small bug in my code and it took three days to find out what went wrong. Maybe this works better now.

It should be possible now to change the font and font size, I limited to fixed-pitched fonts. Changing to bold or italic in the font dialog will only affect the font in the margin. I also added the possibility to change the styles for highlighting - I used schemes as this is simpler than modifiying the styles individually. This is done in O2HEditcolors.inc. If there is a demand for special styles I could add them.

I added additional syntax coloring for WinApi keywords and asm keywords. If there is a recommended link for assembler help than a asm help option could be added to the project.

O2HEdit should work everywhere on harddisk or usb-stick and it can also be started in the OxygenBasic folder. An existing older O2HEdit.cfg must be deleted as otherwise O2HEdit.exe will crash at the moment. It is possible to create a link for O2HEdit on the desktop and open files by dragging and dropping. It is also possible to associate files with O2HEdit.exe so they will be opened directly.

I use a special Scilexer.dll for the project which is included. This dll can be copied to the Oxygenbasic folder. Another way is to set the path for Scilexer.dll with the MenuItem: Opitons / Enironment Settings.

This project aims to be simple but also to be practical for creating small Oxygenbasic applications. What additional features might make sense? At the moment I am reflecting about folding.

Roland

Edit:

Due to some changes added to Oxygenbasic version A43 some small modifications are necessary to compile the source of O2HEdit.o2bas with version A43:

O2HEdit.o2bas:

line 99,100

   static bool h_check=true 'highlighting
   static bool a_check=true 'autoindent

O2HEdit.inc:

line 561

       zstring buffer[10]

line 688

             down=1

line 803
             down=1


.
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 14, 2017, 04:08:33 AM
Thanks Roland, that looks really nice. :)

I'm still focussed on the project/file groups side, and also using the compiler to feed info back to the IDE.

Oxide will be using .o2proj files which can be associated directly with Oxide.exe. You may like to adopt a similar scheme for o2hedit.

Title: Re: A little brother of OxIde
Post by: Arnold on May 14, 2017, 11:36:44 PM
Hi Charles,

thank you for the review. This project is also my attempt to implement what I have learned from you, Mike and John the last two years. And if I should ever manage to add a list with the used files for an application then this will be indeed a cool thing. But at the moment I will concentrate on the basic stuff. I noticed that I will need to turn wrapping lines on/off and that I need a monospace mode which turns bold and italic on/off. Maybe I should add the option for hiding line numbers on/off also.

I noticed that I can use the ExtracData function too for creating the keyword lists. In this way the keywords can be managed in a separate file. Scintilla can support four keyword lists. I used the third list for asm keywords, but I think the third and fourth list could also be used for other purposes e.g. Opengl keywords or the names of the functions in the folder Oxygenbasic/inc.

At the moment I try to retrieve the data of O2HEditColors from a separate file similar to the keyword lists and store them into arrays. I am not sure if there already exists an equivalent procedure provided with Oxygenbasic?

Roland
Title: Re: A little brother of OxIde
Post by: Arnold on May 16, 2017, 02:01:35 AM
Hi Charles,

this is a sub which I would like to use in order to  retrieve arrays from a text file. It is derived from function ExtractData of OxIde. I assume I could use override to apply the sub for other types too. I know there are more solutions possible with Oxygenbasic so maybe the sub could be improved a little bit? Yet I am still not sure if there is already an existing functionality provided with the include files.

Roland

Code: [Select]
include "$/inc/console.inc"

  sub ExtractArray(string *s, k, int arr[], int c) 'array Id, dimension
  'format: $keyword {data}
  sys *array=@arr
  sys a=instr(s,k)
  if a=0 then print k " not found" : exit sub
  a=instr a,s,"{" : if a=0 then print "Error in string " k : exit sub
  b=instr a,s,"}" : if b=0 then print "Error in string " k : exit sub
  if a then
    a++ : st=mid s,a,b-a
  end if
print "text = " & st     
  sys i=1,p=1
  int n,l
  for x=1 to c
    i=instr p,st,","
    if i=0 then exit for
    l=i-p : n=mid(st,p,l) : array[x]=n
    p=i+1 : i=p
  next x
  n=mid(st,p) : array[c]=n
  end sub

'Test

string text = "
$color {
0x000000,0x800000,0x008000,0x808000,0x0000C4,0x800080,0x004080,0xC4C4C4,
0x808080,0xFF0000,0x00FF00,0xFFFF00,0x0000FF,0xFF00FF,0x00FFFF,0xFFFFFF,
0xA4A4A4,0xFFA080,0xA0FFA0,0xFFFFA0,0xA0A0FF,0xFFA0FF,0xA0FFFF,0xD4D4D4,
0xB4B4B4,0xFFDCBC,0xDCFFDC,0xFFFFDC,0xDCDCFF,0xFFDCFF,0xDCFFFF,0xE4E4E4
}
"

dim as int color(32)
ExtractArray text, "$color ", color[], 32
printl
 
for x=1 to 4
   for y=1 to 8 : print "0x" hex(color[(x-1)*8 +y]) "," : next y
printl
next x
printl

printl "Enter..." : waitkey



.
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 17, 2017, 01:52:30 AM
Hi Roland,

These procedures are part of the next ParseUtil.inc, and might be useful to you.

Code: [Select]
function BlockData(string*s, int*i) as string
=============================================
skipspace(s,i)
byte b at i-1+strptr(s)
int lb,rb,d,e,k
def setb k=i+1 : d++
do
  select b
  case 0 : e=i : exit do
  case 1 to 31 : if not lb then e=i : exit do
  case "("  : if not lb then lb=40  : rb=41  : setb
  case "<"  : if not lb then lb=60  : rb=62  : setb
  case "["  : if not lb then lb=91  : rb=93  : setb
  case "{"  : if not lb then lb=123 : rb=125 : setb
  case lb   : d++ 'nesting
  case rb   : d-- : if d<=0 then e=i : i++ : exit do
  case else : if not k then k=i : lb=-1
  end select
  @b++
  i++
end do
skipspace(s,i)
if k then return mid(s,k,e-k)
end function


function ExtractData(string s,w, int i=1) as string
===================================================
  'format: $keyword lbracket data rbracket
  i=instr(i,s,w)
  if i then return BlockData(s,i+len(w))
end function


macro ReadNextItem(w,s,i)
=========================
  w = lcase getitem(s,i)
  select ascb
    case 0  : exit do
    case 44 : continue do
  end select
end macro


macro split(s,d, max,j,  i,w)
=============================
scope
  indexbase 1
  int i = 1
  string w
  do
    ReadNextItem w,s,i
    if j>=max then exit do
    j++
    d[j]=unquote(w)
  end do
end scope
end macro

Extracting datasets then becomes a 2 step process, supporting any primitive array type

Code: [Select]
int d[100], n
string w=ExtractData (s,"$dat ")
split(w,d, 100, n)

.
Title: Re: A little brother of OxIde
Post by: Arnold on May 17, 2017, 09:20:40 AM
Charles,

I tried the example above with the new parseutil.inc and ExtractData works fine. But if I try to split w then I get an error which refers to unquote. I am not sure now if something changed with stringutils.inc too or if I simply used the split macro the wrong way?

Roland
Code: [Select]
include "$/inc/console.inc"

include "parseutil.inc"


string text = "
$color {
0x000000,0x800000,0x008000,0x808000,0x0000C4,0x800080,0x004080,0xC4C4C4,
0x808080,0xFF0000,0x00FF00,0xFFFF00,0x0000FF,0xFF00FF,0x00FFFF,0xFFFFFF,
0xA4A4A4,0xFFA080,0xA0FFA0,0xFFFFA0,0xA0A0FF,0xFFA0FF,0xA0FFFF,0xD4D4D4,
0xB4B4B4,0xFFDCBC,0xDCFFDC,0xFFFFDC,0xDCDCFF,0xFFDCFF,0xDCFFFF,0xE4E4E4
}
"

'string text = "$color [0x000000,0x800000,0x008000,0x808000,0x0000C4,0x800080,0x004080,0xC4C4C4]"

int color[32]
int n=8
string w=ExtractData (text,"$color ")
print "text w ="
printl w

'split(w,color,32, n)

printl "Enter ..." : waitkey
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 18, 2017, 12:55:53 AM
Hi Roland,

Your code works perfectly  on my new system, so I think this is a good time to post another OxygenBasic update: version A43

I've done some reorganisation of the /inc files so they relate better to each other. And I anticipate that this will be the last major update to oxygen.dll, so we can soon move to a beta phase for o2.
Title: Re: A little brother of OxIde
Post by: jcfuller on May 18, 2017, 01:46:30 AM
I've done some reorganisation of the /inc files so they relate better to each other. And I anticipate that this will be the last major update to oxygen.dll, so we can soon move to a beta phase for o2.

Charles,
  This is excellent news. Looking forward to the Beta Release!!!

James
Title: Re: A little brother of OxIde
Post by: Arnold on May 18, 2017, 03:21:47 AM
Hi Charles,

after installing the new release of Oxygenbasic there is no problem any more. I assume n indicates an index which defaults to zero?
When reading Oxylog.txt and Applog.txt it is obvious that you have spent a lot of work since the last release. It will take some time to cope with all the innovations. My editor project works very nice with the new version.
I see that you added the special Scilexer.dll with this release. Maybe it is possible to use the new dll from this post for your next upload:

http://www.oxygenbasic.org/forum/index.php?topic=1490.msg16251#msg16251 (http://www.oxygenbasic.org/forum/index.php?topic=1490.msg16251#msg16251)

This dll is certainly not perfect (a programmer comfortable with C really could do much more). But I added the lexers for VB, PB, FB and Lout with this dll and it reflects the version 3.74 (without c++11 regex). It is only 5kb bigger in size, but I can use it with Scite of your download site and it works with AscEdit2.o2bas and AurelEdit.o2bas too. So there would be a small advantage until there will be a better Scilexer.dll available.

Roland

Code: OxygenBasic
  1. include "$/inc/console.inc"
  2.  
  3. includepath "$/inc/"
  4. include "parseutil.inc"
  5.  
  6. string text = "
  7. $color {
  8. 0x000000,0x800000,0x008000,0x808000,0x0000C4,0x800080,0x004080,0xC4C4C4,
  9. 0x808080,0xFF0000,0x00FF00,0xFFFF00,0x0000FF,0xFF00FF,0x00FFFF,0xFFFFFF,
  10. 0xA4A4A4,0xFFA080,0xA0FFA0,0xFFFFA0,0xA0A0FF,0xFFA0FF,0xA0FFFF,0xD4D4D4,
  11. 0xB4B4B4,0xFFDCBC,0xDCFFDC,0xFFFFDC,0xDCDCFF,0xFFDCFF,0xDCFFFF,0xE4E4E4
  12. }
  13. "
  14.  
  15. int color[32], n
  16. string w=ExtractData (text,"$color ")
  17. print "text w ="
  18. printl w
  19.  
  20. split(w,color,32, n)
  21.  
  22. printl
  23. for x=1 to 4
  24.    for y=1 to 8 : print "0x" hex(color[(x-1)*8 +y]) "," : next y
  25. printl
  26. next x
  27. printl
  28.  
  29. printl "Enter ..." : waitkey
  30.  
Title: Re: A little brother of OxIde
Post by: Aurel on May 18, 2017, 06:06:03 AM
Hi to ALL...  :)
This is really good news ,I only hope that all string functions work without quirks  :D

Quote
AscEdit2.o2bas and AurelEdit.o2bas too

Arnold ..so do you compile this programs with new 043 ?
Title: Re: A little brother of OxIde - AurelEdit
Post by: Arnold on May 18, 2017, 09:57:30 AM
Hi Aurel,

yes I can execute AurelEdit with the new release A43. I am not sure though if I use the latest code of AurelEdit and awinh.inc. I do not compile to an exe file but run AurelEdit directly. I also did not compile or save the files opened with AurelEdit.
You should upload all the files which are necessary for running AurelEdit. I myself prefer to use minwin.inc as much as possible. This does save a lot of redundant work.


.
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 18, 2017, 10:06:57 AM
Hi Roland,

I have left n to be initially set by the caller, this allows multiple data sets to be appended in one array.

I have included your Scintilla.dll, and will update tomorrow. (fixed 2 bugs, and included a few more examples)
Title: Re: A little brother of OxIde
Post by: Aurel on May 18, 2017, 10:56:08 AM
Hi Arnold
Quote
You should upload all the files which are necessary for running AurelEdit
yeah ..I agree but first i must fix things in awinh ,i cannot simply use minwin
by the way where is this download for A043 ?
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 19, 2017, 02:12:32 AM
For the latest A43 click on the wizard's nose :)
Title: Re: A little brother of OxIde
Post by: Aurel on May 19, 2017, 04:52:41 AM
OK Charles  :)

I can compile AurelEdit and looks that work ok.
I still cannot figure how to set more keywords using this new scilexer
as i said before in old 1680 i can use 3 keyword colors using LOUT lexer
but with this new versions i cannot do that ..any help with that ?
arnold maybe ..?
Title: Re: A little brother of OxIde
Post by: Arnold on May 20, 2017, 01:28:44 AM
Hi Aurel,

searching in Internet I found a link for a custom made scintilla lexer for ebasic where I found some messages of you. Do you use this dll for your project? But then you use a specialized dll too and this would not work the same way as the Scintilla Scilexer.dll of version 2.2.0 or the Scilexer.dll for Oxygenbasic. There is a real problem then because the constants for the styles are assigned differently with the different lexers and probably handled differently. I do not know ebasic and it's syntax but for Oxygenbasic I use these assignments (for the special dll):

      ... SCI_SETLEXER, 200, 0   ' SCLEX_OXYGENBASIC

      ... SCI_SETKEYWORDS, 0, strptr OxyKeywords
      ... SCI_SETKEYWORDS, 1, strptr ApiKeywords
      ... SCI_SETKEYWORDS, 2, strptr AsmKeywords

The values for the keyword styles are defined in Scintilla.iface / Scilexer.h:

SCE_B_KEYWORD=3
SCE_B_KEYWORD2=10
SCE_B_KEYWORD3=11
SCE_B_KEYWORD4=12

and I set the FG/BG colors for these styles. The constants for the SCE_B_... values are not the same as the SCE_OB_... values of AurelEdit.o2bas.

Roland






Title: Re: A little brother of OxIde
Post by: Aurel on May 20, 2017, 03:18:07 AM
Hi Arnold
No is not special or custom sci dll than standard version 1.6.8.0
My first editor called OxyEdit is written in Emergence Basic 1.773
this is not clear to me why if all lexers are same i mean on lexer number why then
not work with newer versions
more keywords are useful like ihave
like string,int,float in RED
commands in BLUE
strings in magenta
awinh keywords in BROWN
etc...
Title: Re: A little brother of OxIde
Post by: Arnold on May 20, 2017, 12:24:18 PM
This is what I tried: I downloaded wscite 1.6.8 from Sourceforge and renamed the dll to scilexer168.dll.  I created a copy of AurelEdit.o2bas and used the statement:
hlibsci = LoadLibrary "SciLexer168.dll"  'load sciLexer.dll
Then in the code of the two apps I used the statement:
SendMessage hsci, SCI_SETLEXER, 8, 0   (and also using 40,51,75).

Then I executed the both apps parallel and opened the same code file. I do not know which problems you see with highlighting but I can definitively confirm, that the Scilexer.dll version 1.68 and the special dll for Oxygenbasic show the same individual coloring for VB, Lout, Pb and Fb lexers.


.
Title: Re: A little brother of OxIde
Post by: Aurel on May 21, 2017, 02:40:29 AM
i show you difference
left is with 1.6.8.0 and right is with newer
i dont get it why i cannot have more keywords??

.
Title: Re: A little brother of OxIde
Post by: Arnold on May 21, 2017, 10:01:10 AM
Hi Aurel,

I am sorry but it seems that I cannot be of help in this case. If I run the code which I attached previously (reply #54) using scilexer.dll 1.6.8.0 I will get the result which is displayed in the right picture (sys, int etc. blue). Either your dll is different from that which I downloaded from Sourgeforge or the code of your AurelEdit.o2bas / awinh.inc is different from my previously attached zip file. There is too much speculation to me.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on May 21, 2017, 12:30:44 PM
hi Arnold
Yes it looks that version of 1.6.8.0
is somehow different     than the original and i dont know who made this changes.
Probably author of EBasic but iam not sure...
Only thing what i can do is to download original 1.6.8.0 from SourceForge
and try to compile with this original dll to see how work
thanks for replay and trying  ;)
Title: Re: A little brother of OxIde
Post by: Arnold on May 30, 2017, 01:16:55 AM
Hi Charles,

the last few days I was prevented to do anything with Oxygenbasic and I now downloaded the latest version of A43. When I try to compile OxIde I will get this error:

Must assign to a variable
word: left
line: 69
file: c\oxygenbasic/inc/dirutil.inc
pass: 3

I will get this error with my editor project too. Comparing dirutil.inc / sysutil.inc / oxideutil.inc with version A43 22/05/2017 I cannot see a difference to the version of 27/05/2017. Is there a change anywhere else which must be respected?

Roland
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 30, 2017, 01:50:06 AM

Hi Roland,

It's #compact again. I'll track the problem ...
Title: Re: A little brother of OxIde
Post by: Arnold on May 30, 2017, 01:57:50 AM
Thank you Charles. Commenting out #compact fixed the problem. I must keep this in mind a little bit more. There are some things which I already apply automatically.
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 31, 2017, 02:37:38 AM
I have now fixed the problem with #compact and its removal of unused functions containing inner functions.

There was also a related glitch with #lookahead

http://oxygenbasic.org/o2zips/Oxygen.zip
Title: Re: A little brother of OxIde
Post by: Aurel on May 31, 2017, 05:21:31 AM
Hi Charles
it looks that again something is wrong with new 043 oxygen.dll
i replaced old 041 with this new you posted here and i get this strange error?
so i must back to my old working dll...

.
Title: Re: A little brother of OxIde
Post by: Charles Pegge on May 31, 2017, 05:33:51 AM
Hi Aurel,

I've removed some legacy words from OxygenBasic, and #basic is one of them. o2 was originally an assembler, with Basic as an option. This is no longer the case.

It works with AurelEdit (04/2017) :)
Title: Re: A little brother of OxIde
Post by: Aurel on May 31, 2017, 11:03:14 AM
Hi Charles
But from error i can olny say that o2 react on commented line with word
basic .... is that the case now?
 ::)
Title: Re: A little brother of OxIde
Post by: Charles Pegge on June 02, 2017, 02:06:07 AM
Hi Aurel,

I did not understand your question, but these word have been removed from OxyenBasic core definitions:

exposed writestate #ifexist #ifnexist basic o2h asm #basic #asm data dataspace
Title: Re: A little brother of OxIde
Post by: Aurel on June 02, 2017, 09:20:13 AM
Hi Charles
Please look into error picture..
it looks to me that oxygendll detect word "basic" in comment as keyword
i dont know how to explain better..
 
Title: Re: A little brother of OxIde
Post by: Charles Pegge on June 02, 2017, 09:32:32 AM
Not on my system.

Code: [Select]
'basic
Can you show us?

PS

I have implemented function-name assign:

Code: [Select]
function foo(int v) as int
  foo=v*3
end function
print foo(14) '42
Title: Re: A little brother of OxIde
Post by: Aurel on June 02, 2017, 09:45:57 AM
aha ...so we can use VB,PowerBasic and some other syntax
that is fine but i prefer old way..
ok ..that is good for translation from let say VB to o2
Charles
i really dont have a clue why o2 react on this way on word basic under comment
it looks to me that words are not ignored after sign '
is that the problem ?
Title: Re: A little brother of OxIde
Post by: Charles Pegge on June 02, 2017, 10:03:47 AM
My copy of AurelEdit does not have this problem with 'basic

The only circumstance where ' is not a comment

Code: [Select]
int a=43
select a
case '+' : print chr(a) 'print "+"
case '-' : print chr(a)
end select


Title: Re: A little brother of OxIde
Post by: Arnold on June 27, 2017, 08:40:04 AM
The last two months I was incredibly lazy using my computer, but I got much distracted by the incidents which happen. During my working life I was not really aware of this extent of chaos in the world.

Version A43 introduced true=-1 / false=0. This makes some modifications necessary for O2HEdit.o2bas / O2HEdit.inc. I mentioned these changes in reply #44.

Although I have added some more features to my little editor project I will first of all adapt the code to the latest version of A43 and use some of the new advanced functions.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on June 30, 2017, 01:06:02 AM
Quote
some of the new advanced functions.
which are ?...are they in log file ?
ok

hmm i have a lot of troubles and seems to me that I must do complete reconstruction
of awinh.inc
grrrr.....  >:(

 :D
Title: Re: A little brother of OxIde
Post by: Arnold on December 20, 2017, 08:15:27 AM
Hello,

after a short break I added some small changes to the little editor project. I hopefully reduced the flickering when resizing the editor's window. Also added turning on/off wordwrap, line numbers and monospaced view.

The app should run anywhere on disk or usb stick. It depends on the special SciLexer.dll which is provided with Oxygenbasic otherwise syntax highlighting will not work. The app depends also on colorschemes.bin and keywordlists.bin which are two text files. Colorschemes.bin can be used to define own colorscheme 4 + 5. Keywordlists.bin contains the keywords for Oxygenbasic, WinApi and ASM keyords. Without this file syntax highlighting will not work. Most probably it must be adapted.

The attached zip file only contains the executable without source code because I think the code must be adapted after the forthcoming release of Oxygenbasic. I also would like to add some more items to the project.

Maybe I will get some feedback? Although I did some tests, I am still not sure if everything will work as expected.

Roland
Title: Re: A little brother of OxIde
Post by: Arnold on December 21, 2017, 04:07:19 PM
Wow! This is so embarrassing. When I edited the .rc resource file I deleted by mistake a ctrl mark in the accelerator table. This led to a mistake in the find / replace dialog and I did not realize this. Shame on me.

I attached the corrected executable. Find / Replace should work ok now. Replace All does not work in all cases but I have not yet found out the reason for this misbehaviour.

Roland

.
Title: Re: A little brother of OxIde
Post by: edcronos on June 04, 2018, 06:21:13 AM
Hello
how is progress with your editor for O2 going?
Where can I download to test?
Title: Re: A little brother of OxIde
Post by: Arnold on June 08, 2018, 12:37:42 AM
Hi Eduardo,

O2Hedit is experimental code and based on OxIde. OxIde has different and some more advanced features. There are some small bugs in O2Hedit which I need to fix. I will have to adapt the code to the latest version of O2 and would like to use some in-memory dialogs. But right now I am a bit lazy. I will do that later.

Roland
Title: Re: A little brother of OxIde
Post by: JRS on June 08, 2018, 02:56:05 AM
Don't forget about Aurel's O2 IDE efforts.
Title: Re: A little brother of OxIde
Post by: Aurel on June 10, 2018, 05:39:27 AM
Yo John
I forgot that i must post latest code for Aurel Edit..
 ::)
Title: Re: A little brother of OxIde
Post by: Aurel on November 04, 2018, 11:04:26 PM
Hi Arnold
After all that mumbo -kumbo with find/replace/replace
Do you have working  version ?

Aurel
Title: Re: A little brother of OxIde
Post by: Aurel on April 20, 2019, 04:10:37 AM
Hi Arnold / Roland 

What is the status of your editor?
Do u use it with o2 programming ...
Title: Re: A little brother of OxIde
Post by: Arnold on April 21, 2019, 08:12:23 AM
Hi Zlatko,

in this project, I wanted to learn about the Scintilla edit control and its options, and I know I just touched the basics. I did not look at the code for some time now, Oxygenbasic has changed a little bit since then and I suppose the code would not compile correctly at the moment.

The idea was to create the controls of the app with a resource editor, create a .dll and work out the functions in the main code which would use the resources of the dll file. With a small modification the resources can also be linked directly with LinkRes2Exe (an indeed great app) to the final .exe file.

O2HEdit is based on Oxide, yet Oxide has still some more options. In fact I was interested to learn more about the brilliant ways which Charles applied for using macros and I tried to use the provided Oxygen / Oxide library functions as much as possible. In the meantime I think I could use even more functions.

For my projects I do not use O2HEdit. I am using PSPad, which I have set up to syntax highlight and run apps with Oxygen. But there are other editors which could be used for this purpose too like Scite, Notepad++, Notepad2 etc. These editors can achieve a lot more than my little O2HEdit project. There are also great IDEs like CSED, FBIde or FBEdit that could be customized for Oxygenbasic, if anyone would be interested and if this is allowed at all.

If you downloaded the code of O2HEdit and would like to apply some of the functions with your AsciEdit project, there is no problem; this is code derived from WinApi examples which I found at several places in Internet. I can upload the files of the O2HEdit project once again, but then I have to adapt it to the latest version of Oxygenbasic first. There are at least two problems which must also be examined: changing the config file does not always work correctly, I have to do this manually, and sometimes there is a problem with the "replace all" option.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on April 21, 2019, 08:34:38 AM
Hi Arnold
Thanks for replay and explanation..
PSPad ..you say ..well ok if you are used to this one.
For start o2Hedit is not bad editor at all for such a small size.
And is written with Oxygen Basic...
some of editors you said about for FreeBasic are not written in FreeBasic...hmmm
Yes AsciEdit was old version of  AurelEdit which is completely written in o2 and win api + scintilla
i prefer to use editors i made and  so all my programming with Oxygen basic is with AurelEdit
and with my older OxyEdit
i know they are not advanced and can be improved but for my needs are fine. :)
Title: Re: A little brother of OxIde
Post by: Aurel on December 19, 2019, 09:13:55 AM
hello Roland
I want to add config to my editor then i look into your again
and i found only LoadConfig() routine ..
It looks complex even i understand some parts( not easy to get it what is what in someone else code)
so you basically save config as string then parse this string...is that right?

but where is SaveConfig?

thanks
Title: Re: A little brother of OxIde
Post by: Arnold on December 20, 2019, 10:31:19 AM
Hi Zlatko,

I have not touched the code in a while, it will not compile with the latest version of O2. From today's perspective, I have to admit that it is faulty and that I would start it differently from scratch. But it was just a learning exercise, and there are many good editors that work very well with Oxygenbasic.

Attached is a zip file with the (outdated) project and a 32-bit exe. The zip file  should be unzipped in a separate folder. The O2HEdit.cfg will look like this:

Code: Text
  1. $o2dir [c:\oxygenbasic]
  2. $compiler [c:\oxygenbasic\co2.exe]
  3. $scilexer [c:\oxygenbasic\SciLexer.dll]
  4. $reslinker [c:\oxygenbasic\tools\Linkres2exe.exe]
  5. $rccompiler [c:\oxygenbasic\tools\GoRc.exe]
  6. $reseditor [Resed.exe]
  7. $editor [Wordpad]
  8. $oxyhlp [c:\oxygenbasic\inf\oxygen_help.chm]
  9. $winapihlp [c:\oxygenbasic\inf\Win32.chm]
  10. $dir [c:\oxygenbasic\examples]
  11. $tabspaces [4]
  12. $font [Lucida Console]
  13. $fontsize [14]
  14. $ln_style_bold [0]
  15. $ln_style_italic [0]
  16. $clrscheme [1]
  17.  

Using an editor like notepad / wordpad / oxide all c:\oxygenbasic must be substituted with the correct path of oxygenbasic. Then O2Hedit.exe should start correctly.

As already stated, I consider this code buggy. But at the moment I will not continue / restart this project.

Roland
Title: Re: A little brother of OxIde
Post by: Aurel on December 20, 2019, 02:51:53 PM
Hi Arnold
thanks for files but i was asking you about how to save config file
like a set of strings?
Title: Re: A little brother of OxIde
Post by: Arnold on December 21, 2019, 04:07:54 AM
The sub saveconfig() is located in O2HeditUtils.inc. The string s_cfg is intended to keep a string separated by carriage returns (cr). s_cfg is also used in sub loadConfig() which loads (not quite correctly) O2HEdit.cfg. The Environment Settings for the individual options are done in O2HEdit.inc in sub environment() and function environDlg().

However, the newer versions of Oxygen use #autodim off by default (which is less prone to errors) and include more utility functions in the O2 include files. Therefore, the entire files of the project should be revised.
Title: Re: A little brother of OxIde
Post by: Aurel on December 21, 2019, 07:45:22 AM
The sub saveconfig() is located in O2HeditUtils.inc.

-Thanks,i am looking but without your help and cannot figure where is it

sub loadConfig() which loads (not quite correctly)

- hmmm i will see why not because should do that
probably some string quirks
I have in editor separate window so I will test it outside of editor program.


For my editor i still use old 043 version
even i am not very happy with some things this version work for me.
I will download latest to see how respond on some old code...
Title: Re: A little brother of OxIde
Post by: Charles Pegge on December 21, 2019, 11:29:12 AM
Data strings combined. Very simple to save:

Code: [Select]
     s_cfg= "$o2dir [" & o2dir & "]" & cr &
        "$compiler [" & compiler & "]" & cr &
        "$scilexer [" & SciLib & "]" & cr &
        "$reslinker [" & ResLinker & "]" & cr &
        "$rccompiler [" & RcCompiler & "]" & cr &
        "$reseditor [" & ResEditor & "]" & cr &
        "$editor [" &  extEditor & "]" & cr &
        "$oxyhlp [" & OxyHelp & "]" & cr &
        "$winapihlp [" & WinapiHelp & "]" & cr &
        "$dir [" & dir & "]" & cr &
        "$tabspaces [" & tabspaces & "]" & cr &
        "$font [" & fnt & "]" & cr &
        "$fontsize [" & fnz & "]" & cr &
        "$ln_style_bold [" & LN_style_bold & "]" & cr &
        "$ln_style_italic [" & LN_style_italic & "]" & cr &
        "$clrscheme [" & scheme & "]" & cr

     putfile configdir  & "\O2HEdit.cfg", s_cfg     
     SetCurrentDirectory appdir
     mbox "O2HEdit.cfg saved"
Title: Re: A little brother of OxIde
Post by: Aurel on December 21, 2019, 12:09:06 PM
Hi Charles
and thanks for code ...
my way would be little bit different, at first i will test how things work
then i will create simple string array and put in each element one of items
like :

~theme
~compiler
~etc
~etc

then i will  parse each item into array
so for now i will stay with theme and compiler path
so i tested this and work..  :)

Code: [Select]
SUB SaveConfig

string sConfig , dest
char   cdBuff[256]
GetCurrentDir 256, strptr cdBuff
print cdBuff   'show current folder
sConfig = "~theme " + "[" + str(theme) + "]"   ' res ->  ~theme[1]

   dest = cdBuff + "\AurelEditConf.cfg"
   putfile dest, sConfig


END SUB
Title: Re: A little brother of OxIde
Post by: Aurel on December 22, 2019, 11:48:27 AM
Hi
So far it looks that work OK
OK now i will test extractData() routine..

Code: [Select]
SUB LoadConfig

string sConfig , dest
char   cdBuff[256]
GetCurrentDir 256, strptr cdBuff
'print cdBuff   'show current folder
'sConfig = "~theme" + "[" + str(theme) + "]"   ' res ->  ~theme[1]

   dest = cdBuff + "\AurelEditConf.cfg"
's_cfg = getfile configdir & "\O2HEdit.cfg"
   'if s_cfg then
    ' o2dir=extractData s_cfg, "$o2dir "
    ' compiler=extractData s_cfg, "$compiler "
sConfig = getfile dest
IF sConfig = ""
   MsgBox "Configuration file is EMPTY" + crlf +
          "create new file by opening Option Window!" , "AurelEdit::INFO"
   Return
ELSE
   MsgBox "Configuration file Exists" + crlf + sConfig + crlf +
          "OK!" , "AurelEdit::INFO"
END IF


END SUB