Author Topic: OpenFileDialog  (Read 25718 times)

0 Members and 3 Guests are viewing this topic.

Mike Lobanovsky

  • Guest
Re: OpenFileDialog
« Reply #60 on: July 25, 2014, 04:46:16 AM »
Hi Charles,

Should I understand your remark as an indication that

Code: [Select]
filter = "All files "+sep+"*.*"+sep+"Oxygen files "+sep+"*.o2bas"
concatenation is valid for sep = chr(0) in OxygenBasic?

Aurel

  • Guest
Re: OpenFileDialog
« Reply #61 on: July 25, 2014, 05:38:01 AM »
Mike
I don't know why you insist on Filter string .
In your Eclecta( FBSL IDE) filter string is standard...

FilterString = "FBSL Script Files (*.fbs;*.inc)|*.fbs;*.inc|All Files (*.*)|*.*"

which is the most standard way with separator char " | " ..right ?
It is used in many other languages ..right ?
But this symbol not work in Oxygen  ::)
soo.
Ok i will try again...

Charles Pegge

  • Guest
Re: OpenFileDialog
« Reply #62 on: July 25, 2014, 05:41:24 AM »
Sure Mike. The string concatenator uses length encoding and is not null-aware, except for zstring / char* operands which rely on null terminators.

PS: I've got the remedy (Toy Interp), and I'm going through various related permutations - like compound comparing string functions. Should be ready to post this evening.
« Last Edit: July 25, 2014, 05:57:06 AM by Charles Pegge »

Mike Lobanovsky

  • Guest
Re: OpenFileDialog
« Reply #63 on: July 25, 2014, 06:13:02 AM »
@Aurel:

Hi,

You're seeing the user side of FBSL's filter string only. The inner engine examines this string for the "|" characters (in fact, placeholders) which may not appear in file description and extension pattern strings and substitutes them with zero bytes. Two terminating nulls are also added transparently.

Judging by what Charles says, your O2 filter string concatenation must look like this:

filter = "All files "+sep+"*.*"+sep+"Oxygen files "+sep+"*.o2bas"+sep


@Charles:

Thanks for the clarification. FBSL's dynamic strings are ASCIIZ only so concatenation with chr(0) is not possible. That's why I was asking so insistently.

And thanks for the string comparison remedy too. :)

Mike Lobanovsky

  • Guest
Re: OpenFileDialog
« Reply #64 on: July 25, 2014, 06:37:10 AM »
John,

What's your impression of Windows 8(.1)?

JRS

  • Guest
Re: OpenFileDialog
« Reply #65 on: July 25, 2014, 07:27:24 AM »
Quote from: Mike
What's your impression of Windows 8(.1)?

Sorry Mike, haven't tried it yet. (too scary)


Mike Lobanovsky

  • Guest
Re: OpenFileDialog
« Reply #66 on: July 25, 2014, 08:21:58 AM »
Sorry Mike, haven't tried it yet. (too scary)

Sorry John,

I mistook your Tecgraf Scintilla snapshot for one of your own again.  :-[
« Last Edit: July 25, 2014, 08:29:08 AM by Mike Lobanovsky »

Aurel

  • Guest
Re: OpenFileDialog
« Reply #67 on: July 25, 2014, 08:23:09 AM »
I add one more separator on the end and still nothing  ::)

Mike Lobanovsky

  • Guest
Re: OpenFileDialog
« Reply #68 on: July 25, 2014, 08:28:35 AM »
I add one more separator on the end and still nothing  ::)

Don't despair Aurel,

At any rate, you're one step closer to the solution. You absolutely had to straighten that thing out with the filter string anyway.

Let's see what else might be the problem.


[EDIT]

Quote
tx variable ( default is char[] )

If your tx is a char (byte) array then IMHO depending on the O2 peculiarities, its reference may be:

-- tx, or
-- VarPtr(tx) or &tx, or
-- VarPtr(tx[0]) or &tx[0] if indexbase is 0, or
-- VarPtr(tx[1]) or &tx[1] if indexbase is 1,

but not StrPtr(tx). Can you please check these options out with a direct call to SCI_SETTEXT?
« Last Edit: July 25, 2014, 09:23:42 AM by Mike Lobanovsky »

Aurel

  • Guest
Re: OpenFileDialog
« Reply #69 on: July 25, 2014, 09:56:10 AM »
Quote
if your tx is a char (byte) array then IMHO depending on the O2 peculiarities
i am almost sure about that .
ok Mike i will tray again.. ;)

edit:
OMG

Mike...thank you it work with:
SendMessage hsci,SCI_SETTEXT,0, &script   ' BINGO?

Charles
may i ask ..since when we must use & prefix for string pointer or is this just addres of
byte pointer?
« Last Edit: July 25, 2014, 10:05:46 AM by Aurel »

Charles Pegge

  • Guest
Re: OpenFileDialog
« Reply #70 on: July 25, 2014, 10:39:36 AM »
Aurel,

How have you defined tx ?

Aurel

  • Guest
Re: OpenFileDialog
« Reply #71 on: July 25, 2014, 10:42:22 AM »
I am now really pissed off   >:(
when i try :
SendMessage hsci,SCI_SETTEXT,0, tx
it work... :o
how ?
half of string functions not work properly

Charles i really don't have a clue what you do wrong in this last release.
And you tell me before that you have version of ASciEdit which work for you...
how?

char tx[500000]

in attachment is all...
« Last Edit: July 26, 2014, 02:41:54 PM by Aurel »

Charles Pegge

  • Guest
Re: OpenFileDialog
« Reply #72 on: July 25, 2014, 12:09:42 PM »
Thanks Mike

If you pass a string to an unprototyped procedure, it will pass the string pointer by default: the equivalent of strptr tx

strptr is used to resolve the string pointer for any Oxygen string type, dynamic or otherwise.

And because Aurel has defined tx as char, strptr tx is equivalent to &tx.

If the procedure has a prototype, Oxygen will convert the string type to match the type spec in the prototype.

This part of Oxygen is well exercised, so I think the problem is more concealed, but I recommend using dynamic strings for buffers, since they can be sized to any length

Still performing my testing ceremony for today's work ...
« Last Edit: July 25, 2014, 12:23:31 PM by Charles Pegge »

Mike Lobanovsky

  • Guest
Re: OpenFileDialog
« Reply #73 on: July 25, 2014, 12:22:10 PM »
Thanks Charles,

This pretty much nullifies my entire message so I'm deleting it. But then I must admit I don't understand either why, according to Aurel, his proxy

Code: [Select]
string script
script = tx
SendMessage hsci,SCI_SETTEXT,0, strptr script

works while his direct

Code: [Select]
SendMessage hsci,SCI_SETTEXT,0, strptr tx
doesn't.

Charles Pegge

  • Guest
Re: OpenFileDialog
« Reply #74 on: July 25, 2014, 12:30:18 PM »
That is a symptom of string corruption somewhere.