Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

hotbasic

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 365
  • Category: Basic
  • Founded: Jan 7, 2004
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 16028 - 16058 of 19345   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#16028 From: "fnoware" <fredrik.norling@...>
Date: Sat Nov 1, 2008 7:48 am
Subject: Re: comhelper expert?
fnoware
Send Email Send Email
 
I don't think this will work, you need to get the the content and
parse it within HB by you self because comhelper can't handle arrays.

/F

--- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@...> wrote:
>
> Need to convert the MSXML2.dll
>
> COM programming, still learning.......
>
> any experts here to give some tips? how to convert this?
>
> this one i will try to use to get RSS feeds from a site
>
> I already created the MSXML2.inc from the COMHelper
>
> thanks
>
> grCor
>
>     Dim MyMessage As String
>     Dim lRet As Long
>     Dim lPos As Long
>     Dim RSSChannel As interface
>     Dim RSSItem As interface
>     Dim objNode As interface
>
>     if 1 then GoTo NoFeed
>     sb.caption="" 'clear the message panel
>     MyMessage = txtFeed & ":" 'put the RSS title on the message
>     RSSChannel.CreateObject("MSXML2.DOMDocument") 'create the XML
> object to hold the RSS channel
>     RSSChannel.async = False 'wait till the data's returned
>     RSSChannel.Load txtURL.Text 'load the 'channel' into the XML
> document
>     Set RSSItem = RSSChannel.getElementsByTagName("item") 'get a
list
> of <item> elements
>     If Not RSSItem Is Nothing Then
>         For lPos = 0 To (RSSItem.length - 1) 'for each <item> we
find
>             If bShort Then
>                 Set objNode = RSSItem(lPos).getElementsByTagName
> ("title") 'Get the <title> element
>             Else
>                 Set objNode = RSSItem(lPos).getElementsByTagName
> ("description") 'Get the <description> element
>             End If
>             'note you could also get the URL element to associate it
> with a section of the message ...
>             '(You'd need yo 'break up the message display to do
> this), but it would allow for
>             'clicking on a specific item and loading the related
page.
>             MyMessage = MyMessage & " ...  " & objNode(0).Text
> & " " 'and add the text to the message
>             Set objNode = RSSItem.nextNode 'get the next node in the
> element
>         Next
>     End If
>

#16029 From: hotbasic@yahoogroups.com
Date: Sat Nov 1, 2008 11:10 am
Subject: New file uploaded to hotbasic
hotbasic@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the hotbasic
group.

   File        : /Code Center/Emmazle/ComHelper1.7b.zip
   Uploaded by : emmazle <emmazle@...>
   Description : COM and ActiveX Programming made easier: browse library files,
generate HotBasic includes. FIXES A BUG with progIDs.

You can access this file at the URL:
http://groups.yahoo.com/group/hotbasic/files/Code%20Center/Emmazle/ComHelper1.7b\
.zip

To learn more about file sharing for your group, please visit:
http://help.yahoo.com/l/us/yahoo/groups/original/members/web/index.htmlfiles

Regards,

emmazle <emmazle@...>

#16030 From: "emmazle" <emmazle@...>
Date: Sat Nov 1, 2008 11:49 am
Subject: Re: comhelper expert?
emmazle
Send Email Send Email
 
Hello, I tried using MSXML once, I just did the following:
xml.CreateObject("Msxml2.XMLHTTP")
xml.invoke ("open", "GET", url, 0, void, void)
xml.invoke ("send", void)
defstr s=xml.getstr("responseText")
and then parsed the text result myself.

I see you plan to use MSXML properties.
I suggest trying the following:

RSSChannel.CreateObject("Microsoft.XMLDOM.1.0") 'DOMDocument
RSSChannel.invoke("set_async",0) '.async=False
defint result=RSSChannel.getnum("load", txtURL.Text)
RSSAllItems.pointer=RSSChannel.getnum("getElementsByTagName","item")
'Set RSSItem = RSSChannel.getElementsByTagName("item")
if RSSAllItems.pointer then 'If Not RSSAllItems Is Nothing
     defint count=RSSAllItems.getnum("length")
     for lPos=0 to count-1
         RSSThisItem.pointer=RSSAllItems.getnum("item",lPos)
         ' access the underlying IXMLDOMElement interface:
         RSSThisItem.QueryInterface("{2933BF86-7B36-11D2-B20E-
00C04F983E60}"
         objNode.pointer=RSSThisItem.getnum
("getElementsByTagName","title")
....

I haven't tested it but I hope this can get you started.
Use ComHelper to generate the helper files and search the internet
for examples.

Notice the QueryInterface above: it is needed because RSSThisItem is
an IXMLDOMNode object. By itself, it doesn't support the
getElementsByTagName method. But hidden inside the IXMLDOMNode is an
IXMLDOMElement object, which does support it.

E.

#16031 From: "fnoware" <fredrik.norling@...>
Date: Sat Nov 1, 2008 9:51 pm
Subject: Re: New file uploaded to hotbasic
fnoware
Send Email Send Email
 
Could you please fix the variant problem in the genericcom.in  fiel
that is in the examples folder

/F
--- In hotbasic@yahoogroups.com, hotbasic@yahoogroups.com wrote:
>
>
> Hello,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the hotbasic
> group.
>
>   File        : /Code Center/Emmazle/ComHelper1.7b.zip
>   Uploaded by : emmazle <emmazle@...>
>   Description : COM and ActiveX Programming made easier: browse
library files, generate HotBasic includes. FIXES A BUG with progIDs.
>
> You can access this file at the URL:
>
http://groups.yahoo.com/group/hotbasic/files/Code%20Center/Emmazle/Com
Helper1.7b.zip
>
> To learn more about file sharing for your group, please visit:
>
http://help.yahoo.com/l/us/yahoo/groups/original/members/web/index.htm
lfiles
>
> Regards,
>
> emmazle <emmazle@...>
>

#16032 From: "chordnl" <cor.devisser@...>
Date: Sat Nov 1, 2008 10:51 pm
Subject: suggestion combobox,listbox
chordnl
Send Email Send Email
 
Put list in combobox or listbox

This is used a lot of times

Now i use

dim mylist as list
mylist.additems "1,second item","2,second item"
, is the separator

load the second item in combobox

for cnt = 0 to mylist.itemcount-1
    combo.additems field$(mylist.item(cnt),separator,2) 'read second
field
next cnt

my suggestion

combo.parse mylist,separator,2
or
combo.addlist mylist,separator,2

2=read second field

again saves a lot of time
and then i would make the combox and list object almost prefect

grCor

#16033 From: "emmazle" <emmazle@...>
Date: Sun Nov 2, 2008 9:00 pm
Subject: Re: New file uploaded to hotbasic
emmazle
Send Email Send Email
 
Note taken.

Actually, I'm still hoping that Jim finds a way to support "as
variant" functions...

E.


--- In hotbasic@yahoogroups.com, "fnoware" <fredrik.norling@...>
wrote:
>
> Could you please fix the variant problem in the genericcom.in
fiel
> that is in the examples folder
>
> /F
> --- In hotbasic@yahoogroups.com, hotbasic@yahoogroups.com wrote:
> >
> >
> > Hello,
> >
> > This email message is a notification to let you know that
> > a file has been uploaded to the Files area of the hotbasic
> > group.
> >
> >   File        : /Code Center/Emmazle/ComHelper1.7b.zip
> >   Uploaded by : emmazle <emmazle@>
> >   Description : COM and ActiveX Programming made easier: browse
> library files, generate HotBasic includes. FIXES A BUG with
progIDs.
> >
> > You can access this file at the URL:
> >
> http://groups.yahoo.com/group/hotbasic/files/Code%
20Center/Emmazle/Com
> Helper1.7b.zip
> >
> > To learn more about file sharing for your group, please visit:
> >
>
http://help.yahoo.com/l/us/yahoo/groups/original/members/web/index.ht
m
> lfiles
> >
> > Regards,
> >
> > emmazle <emmazle@>
> >
>

#16034 From: doctor electron <doctorelectron@...>
Date: Sun Nov 2, 2008 11:22 pm
Subject: Re: [HotBasic] Re: comhelper 1.7 and variant type
globalservices1
Send Email Send Email
 
>- ComHelper DIMs a variant,

Let's call that v.

>- passes its addresses as argument to the Invoke method of the COM
>object
>- then the COM object takes care of filling the variant with the
>right result. If any memory allocation needs to be done (to
>accomodate a string, for instance), I assume it is the COM object's
>responsibility. Whose responsibility it is to free it, I am not
>sure...

Probably the COM object has a "free" or "clear" or "initialize"
that might be invoked to avoid any memory leaks that might be
observed if its allocations for data are not properly cleaned
up.

From what I can see, all you want is a copy of the variant since
a pointer to one is not satisfactory.  Since this is just a copy
(v above), seems that the COM object has to worry about memory
clean up, right?

>- on returning, "getnum" gets back the variant filled with the 16
>bytes of the result.

That could be your v variant dimensioned above, right?

>Then, if getnum were to be a function "as variant", the result could
>simply be copied to a 16-bit "result" buffer. (But this is your side
>of the magic).

Here is where I may have problems understanding.  From above, we
already have the copy of the result in v.  Well, maybe v is the
only result and not a copy, but we dimensioned it, so it's in
our app's addressable space.  Now, are you saying you want yet
another copy of v?  If so then,

dim v2 as variant
iret = getnum(.....,@v)  'get variant result in v
memcpy @v2,@v,16         'make a copy of v
'do something with v2
'why we need v2 when we have v is unknown to me!

If I read you right, seems you are saying that COM functions do
not have any "as variant" type; but that, as I wrote previously
in this discussion, they return (1) a pointer to a variant or
(2) use a pointer argument to return a variant.  Either way, you
have the variant -- if (1), with a memcpy and if (2),
immediately in v.

A nominal GETVARIANT keyword would (or would not?) simply be the
two lines of code shown above, right (or wrong)?

Congrats on the your STRIDE program!  ;) Jim

#16035 From: doctor electron <doctorelectron@...>
Date: Sun Nov 2, 2008 11:33 pm
Subject: Re: [HotBasic] Re: comhelper 1.7 and variant type
globalservices1
Send Email Send Email
 
>HRESULT ComFunction (byref variantarg1, byref variantarg2, byref
>variantresult)

Right, above says you get *2* results: (1) an error/success code
(HRESULT) and (2) variant result (presumably if no error).

>Strictly speaking, the return value of a COM function is always
>a "HRESULT", that is, an integer. The "real" result is stored in a
>variant passed byref as the function's last parameter.

Which means that GetNum is perfect for what is needed, right?

>Now, one design choice I made in ComHelper is to put in the
>foreground the "real" function result, and store the error status
>(the HRESULT) in the global variable COMRESULT in the background.
>
>That's because it's much more user-friendly (I think). Just compare:
>
>(standard Windows COM syntax):
>COMRESULT=object.getnum("Left", @vHeight)
>
>(ComHelper syntax):
>vHeight=object.getnum ("Left")

OK, so how does ComHelper signify an error condition when the
above appears in user code?  A showmessage and error exit from
the program?  Since you (or ComHelper) writes the .getnum code
above, don't you have total control over what that code does?
If error, notify end-user; if success, return the integer
result.

Where would user code or ComHelper generated code need anything
else?  Sorry, Emmazle, I know you're brilliant!  I'm just being
honest trying to see what the real point (real need) is and I
guess, having a bit of trouble seeing it.  Let me sort of
speculate.  Do you want

MyVariant = object.GetVariant(....)

or something like that?  If so, the COM functions that ComHelper
invokes are going to provide (or not?) a variant result which
can be copied into MyVariant, right?  In other words, I seem to
be going in circles since MyVariant above is the same as variant
v in my previous post on this today.

Regards, Jim

#16036 From: "emmazle" <emmazle@...>
Date: Mon Nov 3, 2008 2:54 pm
Subject: Re: comhelper 1.7 and variant type
emmazle
Send Email Send Email
 
> >- on returning, "getnum" gets back the variant filled with the 16
> >bytes of the result.
>
> That could be your v variant dimensioned above, right?

YES

> >Then, if getnum were to be a function "as variant", the result
could
> >simply be copied to a 16-bit "result" buffer. (But this is your
side
> >of the magic).
>
> Here is where I may have problems understanding.  From above, we
> already have the copy of the result in v.  Well, maybe v is the
> only result and not a copy, but we dimensioned it, so it's in
> our app's addressable space.  Now, are you saying you want yet
> another copy of v?  If so then,
>
> dim v2 as variant
> iret = getnum(.....,@v)  'get variant result in v
> memcpy @v2,@v,16         'make a copy of v
> 'do something with v2
> 'why we need v2 when we have v is unknown to me!

I just meant: "COPY" to the user variable given as argument
(the X in X=intf.getnum(...))
or to an internal HB buffer in case we are evaluating a formula
(  intf.getnum(...)*Y+Z )


> If I read you right, seems you are saying that COM functions do
> not have any "as variant" type; but that, as I wrote previously
> in this discussion, they return (1) a pointer to a variant or
> (2) use a pointer argument to return a variant.  Either way, you
> have the variant -- if (1), with a memcpy and if (2),
> immediately in v.
>
> A nominal GETVARIANT keyword would (or would not?) simply be the
> two lines of code shown above, right (or wrong)?

I guess so.

> Congrats on the your STRIDE program!  ;) Jim

Thanks! A new version is brewing with quite a few bug fixes (oops)
and a built-in debugger.

E.

#16037 From: "emmazle" <emmazle@...>
Date: Mon Nov 3, 2008 2:56 pm
Subject: Re: comhelper 1.7 and variant type
emmazle
Send Email Send Email
 
> >Now, one design choice I made in ComHelper is to put in the
> >foreground the "real" function result, and store the error status
> >(the HRESULT) in the global variable COMRESULT in the background.
> >
> >That's because it's much more user-friendly (I think). Just
compare:
> >
> >(standard Windows COM syntax):
> >COMRESULT=object.getnum("Left", @vHeight)
> >
> >(ComHelper syntax):
> >vHeight=object.getnum ("Left")
>
> OK, so how does ComHelper signify an error condition when the
> above appears in user code?  A showmessage and error exit from
> the program?  Since you (or ComHelper) writes the .getnum code
> above, don't you have total control over what that code does?
> If error, notify end-user; if success, return the integer
> result.

An Error result should not usually result in program termination. It
just indicates that the result is neither numeric nor a string.
Think of a spreadsheet cell whose formula contains a division by
zero. The program should not fold and quit. Getnum should
tell: "result of cell (x,y) is not a number because of a Division by
Zero error".

Then the programmer can act accordingly, i.e. display a message,
color the cell in red, or anything they please.


Inside INTERFACEgetnum, you will find the following:

<some argument formatting>
dim v as variant
calling of a function with the syntax: HRESULT f(@variantarg1,
@variantarg2, ... @variantargN, @v)
result=v

Currently, in the "result=v" statement, we force conversion of v to
a number because INTERFACEgetnum must be "as long" or "as double".

Ideally, what I suggest is to declare INTERFACEgetnum "as variant"
and to pass the *entire* variant v as function result, thus
preserving its "variant_type" byte.

This would also take care of the case when you do not know IN
ADVANCE if you are going to receive a number, a string, an array or
an error as result.


> Where would user code or ComHelper generated code need anything
> else?  Sorry, Emmazle, I know you're brilliant!  I'm just being
> honest trying to see what the real point (real need) is and I
> guess, having a bit of trouble seeing it.  Let me sort of
> speculate.  Do you want
>
> MyVariant = object.GetVariant(....)
>
> or something like that?  If so, the COM functions that ComHelper
> invokes are going to provide (or not?) a variant result which
> can be copied into MyVariant, right?  In other words, I seem to
> be going in circles since MyVariant above is the same as variant
> v in my previous post on this today.


YES! The whole point is to pass this magic variant "v" to the user.

#16038 From: doctor electron <doctorelectron@...>
Date: Mon Nov 3, 2008 4:21 pm
Subject: Re: [HotBasic] Re: comhelper 1.7 and variant type
globalservices1
Send Email Send Email
 
>> MyVariant = object.GetVariant(....)
<<snip>>
>
>YES! The whole point is to pass this magic variant "v" to the user.

OK, my prototype statement above seems to have sniffed out your
objective.  Honestly, you said that previously, guess I was too
dense to appreciate the meaning.  Anyway, I've already thought
how to code that *very special case*.  For example,

If .GetVariant is used as a source value,

1. the destination value must be a dimensioned variant
(MyVariant above) else compiler ERROR.

2. .GetNum will be run and the author will be responsible for
writing .GetVariant code which returns a valid pointer to a
variant result else (a) run-time invalid address error or (b)
false result returned in #3 below.

That is, if v is your variant result in your interface coding,
then result=@v is what the new .GetVariant should return.

3. HB will then automate copying the result variant to the
destination variant (MyVariant above).

If this "reasonable" logic and error-checking is not OK or you
have other ideas, please advise.  I'll work up a new HB version
with the .GetVariant keyword (special case of .GetNum).

Thanks, Emmazle, for your patience in nursing me through the
details on this development!  Cheers, Jim

#16039 From: "emmazle" <emmazle@...>
Date: Mon Nov 3, 2008 4:57 pm
Subject: Re: comhelper 1.7 and variant type
emmazle
Send Email Send Email
 
--- In hotbasic@yahoogroups.com, doctor electron
<doctorelectron@...> wrote:
>
> >> MyVariant = object.GetVariant(....)
> <<snip>>
> >
> >YES! The whole point is to pass this magic variant "v" to the
user.
>
> OK, my prototype statement above seems to have sniffed out your
> objective.  Honestly, you said that previously, guess I was too
> dense to appreciate the meaning.  Anyway, I've already thought
> how to code that *very special case*.  For example,
>
> If .GetVariant is used as a source value,
>
> 1. the destination value must be a dimensioned variant
> (MyVariant above) else compiler ERROR.
>
> 2. .GetNum will be run and the author will be responsible for
> writing .GetVariant code which returns a valid pointer to a
> variant result else (a) run-time invalid address error or (b)
> false result returned in #3 below.
>
> That is, if v is your variant result in your interface coding,
> then result=@v is what the new .GetVariant should return.
>
> 3. HB will then automate copying the result variant to the
> destination variant (MyVariant above).
>
> If this "reasonable" logic and error-checking is not OK or you
> have other ideas, please advise.  I'll work up a new HB version
> with the .GetVariant keyword (special case of .GetNum).
>
> Thanks, Emmazle, for your patience in nursing me through the
> details on this development!  Cheers, Jim
>

Sounds good!

Actually you could choose:

a) to maintain the current GETNUM as is, which could be
implemented "as double", and which would cover all cases where the
programmer is sure that a numeric value will be returned,

and b) create a parallel GETVARIANT "as variant", whose ComHelper
implementation would be to return "v".

E.

#16041 From: doctor electron <doctorelectron@...>
Date: Tue Nov 4, 2008 4:33 pm
Subject: 5.7c .GetVariant Custom Object function
globalservices1
Send Email Send Email
 
Nov 4 HotBasic 5.7c adds a .GetVariant function for Custom
Objects, particularly useful in COM programming (please see
ComHelper).  Syntax:

MyVariant = MyObject.GetVariant(...optional arguments...)

where your GetVariant code returns a LONG pointer to the desired
result variant and HotBasic takes care of the rest.  Demo:

=====COinvoke3.bas
$APPTYPE CONSOLE: $TYPECHECK ON

color 15: PRINT "HotBasic Custom Object .GetVariant"

'''''
object invoketest
   getvariant as function
end invoketest

declare function getvariant as long

function getvariant
dim v as variant
v="hello"
result=@v  'return address of result variant
end function
'''''

dim it as invoketest
dim r as variant

color 11: PRINT "4. Test GETVARIANT keyword": color 7
r = it.getvariant  'can add args here (...)
print "result = "; r

PAUSE
END
=====COinvoke3.bas

which supplements the COinvoke.bas demo in HotThing.

.GetVariant returns a compile ERROR if the destination variable
(r above) is not a VARIANT of if the .GetVariant quantity is
used in an expression.

Your .GetVariant routine code must return a pointer to the
desired result variant (as if it were a .GetNum as LONG
function).  That is, notice that your .GetVariant procedure is
declared "as LONG" not "as VARIANT".

[When there is an ABI standard for function returns "as VARiANT"
that I can find and learn, then I can implement this type more
generally for any declared function.]

Ping Emmazle:  Re report that .GetNum does not work when
declared "as DOUBLE", that oversight on my part has been fixed
in 5.7c; thanks for report!]

Happy Computing and COM programming!  Jim

#16042 From: "efgee2003" <efgee2003@...>
Date: Tue Nov 4, 2008 6:18 pm
Subject: Re: 5.7c .GetVariant Custom Object function
efgee2003
Send Email Send Email
 
Thank you for your hard work, will download it right away.

One question:
Is this new version in beta state?

Thanks again
efgee

#16043 From: doctor electron <doctorelectron@...>
Date: Tue Nov 4, 2008 8:58 pm
Subject: Re: [HotBasic] Re: 5.7c .GetVariant Custom Object function
globalservices1
Send Email Send Email
 
>Is this new version in beta state?

See how we get into a grove?  Yes, this and all new releases
will be beta for a time (meaning operationally that issue
reports should be by private email in that period).  I'll change
the web site NEWS listing.  Thanks for reminding me!  ;) j

Maj. Hog:  Note how the news media has been talking all day
about this important event -- the release of HotBasic 5.7c.

#16044 From: "enpsuedo" <sexmotron@...>
Date: Wed Nov 5, 2008 7:05 am
Subject: Re: 5.7c .GetVariant Custom Object function
enpsuedo
Send Email Send Email
 
Certainly looking forward to this as I use COM in my project.

Will it work correctly for all types of variant returns?

Eg, Variant Safearrays etc.

I can't test at the moment,
so asking while we're in the throngs
of slaying the variant beast.

:)


I didn't realize there were so many.

http://www.marin.clara.net/COM/variant_type_definitions.htm


Cheers,


.enpsuedo




--- In hotbasic@yahoogroups.com, doctor electron <doctorelectron@...>
wrote:
>
> Nov 4 HotBasic 5.7c adds a .GetVariant function for Custom
> Objects, particularly useful in COM programming (please see
> ComHelper).  Syntax:
>
> MyVariant = MyObject.GetVariant(...optional arguments...)
>
> where your GetVariant code returns a LONG pointer to the desired
> result variant and HotBasic takes care of the rest.  Demo:
>
> =====COinvoke3.bas
> $APPTYPE CONSOLE: $TYPECHECK ON
>
> color 15: PRINT "HotBasic Custom Object .GetVariant"
>
> '''''
> object invoketest
>   getvariant as function
> end invoketest
>
> declare function getvariant as long
>
> function getvariant
> dim v as variant
> v="hello"
> result=@v  'return address of result variant
> end function
> '''''
>
> dim it as invoketest
> dim r as variant
>
> color 11: PRINT "4. Test GETVARIANT keyword": color 7
> r = it.getvariant  'can add args here (...)
> print "result = "; r
>
> PAUSE
> END
> =====COinvoke3.bas
>
> which supplements the COinvoke.bas demo in HotThing.
>
> .GetVariant returns a compile ERROR if the destination variable
> (r above) is not a VARIANT of if the .GetVariant quantity is
> used in an expression.
>
> Your .GetVariant routine code must return a pointer to the
> desired result variant (as if it were a .GetNum as LONG
> function).  That is, notice that your .GetVariant procedure is
> declared "as LONG" not "as VARIANT".
>
> [When there is an ABI standard for function returns "as VARiANT"
> that I can find and learn, then I can implement this type more
> generally for any declared function.]
>
> Ping Emmazle:  Re report that .GetNum does not work when
> declared "as DOUBLE", that oversight on my part has been fixed
> in 5.7c; thanks for report!]
>
> Happy Computing and COM programming!  Jim
>

#16045 From: "chordnl" <cor.devisser@...>
Date: Wed Nov 5, 2008 7:59 am
Subject: left,mid,right problem
chordnl
Send Email Send Email
 
$apptype console

when copying parts of text to another string the quote char
is not copied well,see output

other char have the same problem like ë and so on

defstr test="the text quotes are `between text' not copied right"

print left$(test,25)
print mid$(test,15,25)
print right$(test,25)

pause

#16046 From: "chordnl" <cor.devisser@...>
Date: Wed Nov 5, 2008 8:09 am
Subject: Re: left,mid,right problem
chordnl
Send Email Send Email
 
test.MemCopyTo(temp$,25)

will also fail to show the right char

What to do to show this normal char(s) the right way?

grCor
--- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@...> wrote:
>
> $apptype console
>
> when copying parts of text to another string the quote char
> is not copied well,see output
>
> other char have the same problem like ë and so on
>
> defstr test="the text quotes are `between text' not copied right"
>
> print left$(test,25)
> print mid$(test,15,25)
> print right$(test,25)
>
> pause
>

#16047 From: "chordnl" <cor.devisser@...>
Date: Wed Nov 5, 2008 8:56 am
Subject: Re: left,mid,right problem
chordnl
Send Email Send Email
 
This is also shown in my gui application when tried to display text
in the combobox

grCor

--- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@...> wrote:
>
> test.MemCopyTo(temp$,25)
>
> will also fail to show the right char
>
> What to do to show this normal char(s) the right way?
>
> grCor
> --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@> wrote:
> >
> > $apptype console
> >
> > when copying parts of text to another string the quote char
> > is not copied well,see output
> >
> > other char have the same problem like ë and so on
> >
> > defstr test="the text quotes are `between text' not copied right"
> >
> > print left$(test,25)
> > print mid$(test,15,25)
> > print right$(test,25)
> >
> > pause
> >
>

#16048 From: "chordnl" <cor.devisser@...>
Date: Wed Nov 5, 2008 9:35 am
Subject: Re: left,mid,right problem
chordnl
Send Email Send Email
 
If you do any string operation like field$,mid and so on

the e.g. ë  char is converted the wrong way

grCor

--- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@...> wrote:
>
> This is also shown in my gui application when tried to display text
> in the combobox
>
> grCor
>
> --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@> wrote:
> >
> > test.MemCopyTo(temp$,25)
> >
> > will also fail to show the right char
> >
> > What to do to show this normal char(s) the right way?
> >
> > grCor
> > --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@> wrote:
> > >
> > > $apptype console
> > >
> > > when copying parts of text to another string the quote char
> > > is not copied well,see output
> > >
> > > other char have the same problem like ë and so on
> > >
> > > defstr test="the text quotes are `between text' not copied
right"
> > >
> > > print left$(test,25)
> > > print mid$(test,15,25)
> > > print right$(test,25)
> > >
> > > pause
> > >
> >
>

#16049 From: "chordnl" <cor.devisser@...>
Date: Wed Nov 5, 2008 10:22 am
Subject: Re: left,mid,right problem
chordnl
Send Email Send Email
 
if e.g. the ë is in a string list and you save it to a file

then the list cotains the ë  char
but when you load it and do string action with it it fails

Hope you will have enough information

grCor



defstr itemList

itemList.savetofile(file.txt)


--- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@...> wrote:
>
> If you do any string operation like field$,mid and so on
>
> the e.g. ë  char is converted the wrong way
>
> grCor
>
> --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@> wrote:
> >
> > This is also shown in my gui application when tried to display
text
> > in the combobox
> >
> > grCor
> >
> > --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@> wrote:
> > >
> > > test.MemCopyTo(temp$,25)
> > >
> > > will also fail to show the right char
> > >
> > > What to do to show this normal char(s) the right way?
> > >
> > > grCor
> > > --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@>
wrote:
> > > >
> > > > $apptype console
> > > >
> > > > when copying parts of text to another string the quote char
> > > > is not copied well,see output
> > > >
> > > > other char have the same problem like ë and so on
> > > >
> > > > defstr test="the text quotes are `between text' not copied
> right"
> > > >
> > > > print left$(test,25)
> > > > print mid$(test,15,25)
> > > > print right$(test,25)
> > > >
> > > > pause
> > > >
> > >
> >
>

#16050 From: "chordnl" <cor.devisser@...>
Date: Wed Nov 5, 2008 12:32 pm
Subject: Re: left,mid,right problem
chordnl
Send Email Send Email
 
In an otherlanguage it is working:

mystr.s="Music ë Song"
mystr=Left(mystr,8)
'put it into a combobox
         For k=0 To 30
           AddGadgetItem(4, -1, mystr + Str(k))
         Next

No need to do special conversion

grCor

--- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@...> wrote:
>
> if e.g. the ë is in a string list and you save it to a file
>
> then the list cotains the ë  char
> but when you load it and do string action with it it fails
>
> Hope you will have enough information
>
> grCor
>
>
>
> defstr itemList
>
> itemList.savetofile(file.txt)
>
>
> --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@> wrote:
> >
> > If you do any string operation like field$,mid and so on
> >
> > the e.g. ë  char is converted the wrong way
> >
> > grCor
> >
> > --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@> wrote:
> > >
> > > This is also shown in my gui application when tried to display
> text
> > > in the combobox
> > >
> > > grCor
> > >
> > > --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@>
wrote:
> > > >
> > > > test.MemCopyTo(temp$,25)
> > > >
> > > > will also fail to show the right char
> > > >
> > > > What to do to show this normal char(s) the right way?
> > > >
> > > > grCor
> > > > --- In hotbasic@yahoogroups.com, "chordnl" <cor.devisser@>
> wrote:
> > > > >
> > > > > $apptype console
> > > > >
> > > > > when copying parts of text to another string the quote char
> > > > > is not copied well,see output
> > > > >
> > > > > other char have the same problem like ë and so on
> > > > >
> > > > > defstr test="the text quotes are `between text' not copied
> > right"
> > > > >
> > > > > print left$(test,25)
> > > > > print mid$(test,15,25)
> > > > > print right$(test,25)
> > > > >
> > > > > pause
> > > > >
> > > >
> > >
> >
>

#16051 From: doctor electron <doctorelectron@...>
Date: Wed Nov 5, 2008 1:44 pm
Subject: Re: [HotBasic] Re: 5.7c .GetVariant Custom Object function
globalservices1
Send Email Send Email
 
>Will it work correctly for all types of variant returns?

Yes.  Whatever variant is specified by code written for a
.GetVariant routine will merely be copied to your destination
variable.  Thus, if Windows (or your .GetVariant code) makes the
variant, you can get an exact copy.
Cheers, Jim

P.S.

So far, there are no issue reports by private email for 5.7c.

GetVariant was added to the Manual (hbsetup with Manual
checked).

#16052 From: doctor electron <doctorelectron@...>
Date: Wed Nov 5, 2008 2:06 pm
Subject: Re: [HotBasic] left,mid,right problem
globalservices1
Send Email Send Email
 
Long, long ago, chordnl, a life form in far off space, emitted:

>when copying parts of text to another string the quote char
>is not copied well,see output

With

=====squotes.bas
$APPTYPE CONSOLE
defstr test="the text quotes are `between text' not copied
right"

print left$(test,25)
print mid$(test,15,25)
print right$(test,25)
PAUSE
END
=====squotes.bas

I get this display:

the text quotes are `betw
s are `between text' not
en text' not copied right
Press a key to continue...

which appears 100% correct.  Regards, Jim

P.S. The character between Music and Song in your next posts is
&H89.  Since that's not on my keyboard as such, I can

print "Music "+chr$(&H89)+" Song"

and I get

Music ë Song

as you do.

#16053 From: "fnoware" <fredrik.norling@...>
Date: Wed Nov 5, 2008 2:38 pm
Subject: Re: left,mid,right problem
fnoware
Send Email Send Email
 
This work ok for me too.

Could it be the STRtoOEM function that is needed
Try to send your string thru this function, and print it after.

/F
declare sub CharToOemA lib "user32" (lpszSrc as string,lpszDst as
string) as long
Declare function STROEM (OrgText as string) as string
function STROEM  '(OrgText as string) as string
	 defstr str1=OrgText
	 defstr str2=String$(str1.length,chr$(0))
	 CharToOemA(str1,str2)
	 RESULT=str2
end function

--- In hotbasic@yahoogroups.com, doctor electron <doctorelectron@...>
wrote:
>
> Long, long ago, chordnl, a life form in far off space, emitted:
>
> >when copying parts of text to another string the quote char
> >is not copied well,see output
>
> With
>
> =====squotes.bas
> $APPTYPE CONSOLE
> defstr test="the text quotes are `between text' not copied
> right"
>
> print left$(test,25)
> print mid$(test,15,25)
> print right$(test,25)
> PAUSE
> END
> =====squotes.bas
>
> I get this display:
>
> the text quotes are `betw
> s are `between text' not
> en text' not copied right
> Press a key to continue...
>
> which appears 100% correct.  Regards, Jim
>
> P.S. The character between Music and Song in your next posts is
> &H89.  Since that's not on my keyboard as such, I can
>
> print "Music "+chr$(&H89)+" Song"
>
> and I get
>
> Music ë Song
>
> as you do.
>

#16054 From: doctor electron <doctorelectron@...>
Date: Wed Nov 5, 2008 4:53 pm
Subject: Re: [HotBasic] Re: left,mid,right problem
globalservices1
Send Email Send Email
 
>Declare function STROEM (OrgText as string) as string
>function STROEM  '(OrgText as string) as string
> defstr str1=OrgText
> defstr str2=String$(str1.length,chr$(0))
> CharToOemA(str1,str2)
> RESULT=str2
>end function

Here's a very pedantic (sorry) revision of your fine code --
showing some short-cuts coders (new and old) might like:

Declare function STROEM (OrgText as string) as string
function STROEM  '(OrgText as string) as string
   defstr str2=OrgText  'make copy of same length
   CharToOemA(OrgText,str2)
   RESULT=str2
end function

Cheers, Jim

#16055 From: doctor electron <doctorelectron@...>
Date: Wed Nov 5, 2008 5:05 pm
Subject: Re: [HotBasic] Re: left,mid,right problem
globalservices1
Send Email Send Email
 
>CharToOemA(str1,str2)

Actually, this might work ... no function, just the API call!

CharToOemA(OrgText,OrgText)

where any string (OrgText above) is simply overwritten by
CharToOemA, assuming the output string is the same length as the
input string and single character substitutions are made by
CharToOemA.  ;) j

#16056 From: "chordnl" <cor.devisser@...>
Date: Wed Nov 5, 2008 4:47 pm
Subject: just downloaded a little demo to show the problem
chordnl
Send Email Send Email
 
grCor

the ' show in the comboxbox different chars

stroem does not help

#16057 From: hotbasic@yahoogroups.com
Date: Wed Nov 5, 2008 5:08 pm
Subject: New file uploaded to hotbasic
hotbasic@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the hotbasic
group.

   File        : /Test Bed/RSSNewsFeeder.zip
   Uploaded by : chordnl <cor.devisser@...>
   Description : wrong char in combobox

You can access this file at the URL:
http://groups.yahoo.com/group/hotbasic/files/Test%20Bed/RSSNewsFeeder.zip

To learn more about file sharing for your group, please visit:
http://help.yahoo.com/l/us/yahoo/groups/original/members/web/index.htmlfiles

Regards,

chordnl <cor.devisser@...>

#16058 From: doctor electron <doctorelectron@...>
Date: Wed Nov 5, 2008 10:47 pm
Subject: Re: [HotBasic] just downloaded a little demo to show the problem
globalservices1
Send Email Send Email
 
>the ' show in the comboxbox different chars

Not here:

=====sq_in_cb.bas
create f As FORM
   create cb as combobox
     width=100
     additems "'","''","'''"
     itemindex=zero
   end create
end create
f.showmodal
END
=====sq_in_cb.bas

If the font you are using (default or whatever it is) for the
COMBOBOX is not showing the characters as desired, change it to
one that does.

This suggestion is based on the assumptions

(1) you may have some default font re the applicable European
language(s) and keyboard(s) which just doesn't get the job done
for what you want to display in your COMBOBOX.

(2) there must be some font that exists on your side of the
Atlantic which can show a single quote!

Cheers, Jim

Messages 16028 - 16058 of 19345   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help