Re: [Gambas-user] Two minor bugs

2009-03-03 Thread Robert Moss
I agree an option would be nice, the screenshot is beautiful in this regard.

@ Ron: Lazy coder

On Thu, Feb 26, 2009 at 10:01 AM, Ron_1st ron...@tiscali.nl wrote:

 On Thursday 26 February 2009, Rolf-Werner Eilert wrote:

 ---8---

  
   Best regards,
  
   Ron_1st
  
 
  Hi Ron,
 
  just FYI, I found where it is and just switched it off. Here is what I
 did:
 
  Download the source, unpack and ./configure.
 
  Then look for source-dir/gb.qt/src/CGridView.cpp and open it in an
  editor. Look for
 
  void MyTable::updateLastColumn()
 
  and quote the line
 
if (!_last_col_width)
 
  as well as the two lines
 
if (((columnPos(n) ...
setColumnWidth(n, ...
 
  by just setting a // at their beginnings.
 
  Then make
  and make install
 
  and the feature has gone... :-)
 
  Rolf
 

 LOL, sneaky hacker :):)

 Thats the beauty of opensource.

 You are not only learn programming/reading the Basic code
 but also learn to read C code at least.
 And for me is the code Benoit is writing good stuff to learn.

 For me he did make _the_ example how to use the macros in C code
 to use them in the gambas project.
 For me it is a good frame work and I can still learn from.

 Thank for the hint. I did not realised to do it that way.
 Now I should read the 'patch' documentation so I can
 easy patch the next version of the source code when released.


 --
  A: Delete the text you reply on.
  Q: What to do to get my post on top?
 ---
  A: Because it messes up the order in which people normally read text.
  Q: Why is top-posting such a bad thing?
 ---
  A: Top-posting.
  Q: What is the most annoying thing in e-mail?



 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] help with data import into postgres - funny characters import fails

2009-02-26 Thread Robert Moss
Is the error a Gambas error or a Postgres error? It might be they are using
a charset with special keys spefic to their industry, which might indicate
more data, or, more likely, the data is errorenous and got bit-shifted, and
now, the high-order bit might be too large to be part of the UTF-8 charset.
I would see if you can get the binary/hex of those keys, and shift the bits
each way by one, (try two also), and then if one of them makes sense, you
know its a communication error (that got uncorrected??? doesn't sound like
TCP).

Since you've never encountered these characters, the most likely scenario is
data corruption. Try to correct it with a bitshift, and if that works, write
code to search for high-order bits that are incorrect, and shift the
sequence appropriately.

Let me know what you think ^_^

-Robert

On Thu, Feb 26, 2009 at 5:57 PM, richard terry rte...@pacific.net.auwrote:

 Hi ,

 I'm trying to import the hl7 from a local radiology provider:
 It's got funny characters in the file and postgres baulks when I go to save
 the line with the message attatched, but it basically says - invalid byte
 sequence for encoding UTF8.

 My postgres database is created with UTF8 encoding

 CREATE DATABASE 27Feb09
  WITH OWNER = richard
   ENCODING = 'UTF8';

 snipped is the offending bit:

 with a maximum AP diameter\.br\of 1.0cm and a less than 50% stenosis in its
 proximal segment.  \.br\\.br\Continued�/2\.br\In the mid superficial
 femoral artery there is staccato flow and an

 I've imported thousands and thousands of lines from a pathology provider
  and
 never encountered these characters.

 Thanks in anticipation.


 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] help with data import into postgres - funny characters import fails

2009-02-26 Thread Robert Moss
Sorry to post two messages, but I just thought of something. Maybe they are
nulls, and maybe postgres has a problem importing nulls into a string
datatype. Just a thought to look into. DEFINITELY look at the hex
representation (ideally next to the character representation) and see if you
can identify what the characters are. UTF characters often take this form
(on little-endian[first], hi-order 2nd) 24 04   |   52 04nulls
obviously: 00 00, and bitshifted:  40 45 | 20 42.

On Thu, Feb 26, 2009 at 8:11 PM, Robert Moss the.at.rob...@gmail.comwrote:

 Is the error a Gambas error or a Postgres error? It might be they are using
 a charset with special keys spefic to their industry, which might indicate
 more data, or, more likely, the data is errorenous and got bit-shifted, and
 now, the high-order bit might be too large to be part of the UTF-8 charset.
 I would see if you can get the binary/hex of those keys, and shift the bits
 each way by one, (try two also), and then if one of them makes sense, you
 know its a communication error (that got uncorrected??? doesn't sound like
 TCP).

 Since you've never encountered these characters, the most likely scenario
 is data corruption. Try to correct it with a bitshift, and if that works,
 write code to search for high-order bits that are incorrect, and shift the
 sequence appropriately.

 Let me know what you think ^_^

 -Robert


 On Thu, Feb 26, 2009 at 5:57 PM, richard terry rte...@pacific.net.auwrote:

 Hi ,

 I'm trying to import the hl7 from a local radiology provider:
 It's got funny characters in the file and postgres baulks when I go to
 save
 the line with the message attatched, but it basically says - invalid byte
 sequence for encoding UTF8.

 My postgres database is created with UTF8 encoding

 CREATE DATABASE 27Feb09
  WITH OWNER = richard
   ENCODING = 'UTF8';

 snipped is the offending bit:

 with a maximum AP diameter\.br\of 1.0cm and a less than 50% stenosis in
 its
 proximal segment.  \.br\\.br\Continued�/2\.br\In the mid superficial
 femoral artery there is staccato flow and an

 I've imported thousands and thousands of lines from a pathology provider
  and
 never encountered these characters.

 Thanks in anticipation.


 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Using a socket to download an image. Please Help ^_^

2008-11-30 Thread Robert Moss
I am trying to get an image (or any binary data) downloaded from a website
and into a jpg file. I expect I will need to use the Byte[] datatype, but I
absolutely can NOT use Callbacks when the data comes in this time.

Here is my example:

DIM RequestString as string
DIM sTotal as string
DIM sBuf as string

Sock.Connect(host,80)
RequestString = MakeGetRequest(/imagesurl.jpg) 'returns a string like
HTTP/1.1 GET /page... \r\n its all correct
WRITE #Sock, RequestString, Len(RequestString)

'Code to wait for connection, etc is removed for brevity

DO UNTIL(EOF(#Sock))
READ #Sock, sBuf, Lof(Sock)
sTotal = sBuf
LOOP

CLOSE #Sock

And after I separate the Content of the reply and dump it to a file, its not
readable, I presume this is because I am trying to write binary data as a
string

p1 = InStr(sTotal, \r\n\r\n)

ImgData = Mid(sTotal, p1)

OPEN localimg.jpg FOR OUTPUT CREATE AS #myFile
WRITE #myFile, ImgData, Len(ImgData)
CLOSE #myFile


Keep in mind, the http request looks something like

HTTP/1.0 200 OK
Header-X: Value1
Content-Type: image/jpeg

AFdka;h3ijaf #RVA  'Image Data

So I need a way to correctly write the binary data to a file without also
including the content headers


Thank you
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Using a socket to download an image. Please Help ^_^

2008-11-30 Thread Robert Moss
Sorry that's not it, I mis-copied the line, in the actual code it does
Mid(sData, p1 + 4)

On Sun, Nov 30, 2008 at 2:39 AM, Doriano Blengino 
[EMAIL PROTECTED] wrote:

 Robert Moss ha scritto:
  I am trying to get an image (or any binary data) downloaded from a
 website
  and into a jpg file. I expect I will need to use the Byte[] datatype, but
 I
  absolutely can NOT use Callbacks when the data comes in this time.
 
  ...
 
  DO UNTIL(EOF(#Sock))
  READ #Sock, sBuf, Lof(Sock)
  sTotal = sBuf
  LOOP
 
  CLOSE #Sock
 
 
  p1 = InStr(sTotal, \r\n\r\n)
 
  ImgData = Mid(sTotal, p1)
 
  OPEN localimg.jpg FOR OUTPUT CREATE AS #myFile
  WRITE #myFile, ImgData, Len(ImgData)
  CLOSE #myFile
 
 I think there is a problem with InStr(...,\r\n\r\n).
 By taking mid$(...,p1), you retain the two CRLFs, which are not good at
 the beginning of a jpeg file.
 You should get rid of the first 4 characters. May be there are still
 other problems, but this is one for sure.

 Regards,

 --
 Doriano Blengino

 Listen twice before you speak.
 This is why we have two ears, but only one mouth.


 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Using a socket to download an image. Please Help ^_^

2008-11-30 Thread Robert Moss
The ImgData stops writing when it comes to a byte with value H00 (I
believe) although I'm pretty sure it doesn't matter how I write the stream,
once it's read as a String, it becomes terminated by any NULL char. So my
question is this: How do I read the data from the Socket in binary, write it
to a stream file in binary, but STILL I MUST be able to split the data based
on the 2 CRLF's

On Sun, Nov 30, 2008 at 11:48 AM, Robert Moss [EMAIL PROTECTED]wrote:

 Sorry that's not it, I mis-copied the line, in the actual code it does
 Mid(sData, p1 + 4)

 On Sun, Nov 30, 2008 at 2:39 AM, Doriano Blengino 
 [EMAIL PROTECTED] wrote:

 Robert Moss ha scritto:
  I am trying to get an image (or any binary data) downloaded from a
 website
  and into a jpg file. I expect I will need to use the Byte[] datatype,
 but I
  absolutely can NOT use Callbacks when the data comes in this time.
 
  ...
 
  DO UNTIL(EOF(#Sock))
  READ #Sock, sBuf, Lof(Sock)
  sTotal = sBuf
  LOOP
 
  CLOSE #Sock
 
 
  p1 = InStr(sTotal, \r\n\r\n)
 
  ImgData = Mid(sTotal, p1)
 
  OPEN localimg.jpg FOR OUTPUT CREATE AS #myFile
  WRITE #myFile, ImgData, Len(ImgData)
  CLOSE #myFile
 
 I think there is a problem with InStr(...,\r\n\r\n).
 By taking mid$(...,p1), you retain the two CRLFs, which are not good at
 the beginning of a jpeg file.
 You should get rid of the first 4 characters. May be there are still
 other problems, but this is one for sure.

 Regards,

 --
 Doriano Blengino

 Listen twice before you speak.
 This is why we have two ears, but only one mouth.


 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the
 world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Using an Image in a PictureBox or help with my issue

2008-11-25 Thread Robert Moss
I see. That's a little more complicated than I would have liked, but it's a
good solution. Is there anyway I can make myObj an alias for PicBox.Image ?

like
Dim myImg as Image
myImg = PicBox.Image

Would that make a copy or assign myImg PicBox.Image's reference


On Mon, Nov 24, 2008 at 9:58 AM, John Harrold [EMAIL PROTECTED]wrote:

 Hi

 Load the image into the picturebox like:

 PictureBox1.Picture = Picture.load(images/bookmark.png)  (Here you use
 the
 path and filename to your image.)

 Then you can do the following:

 Message(Str(PictureBox1.Picture.Image[x, y]))

 Budgieboy

 2008/11/23 Doriano Blengino [EMAIL PROTECTED]

  Robert Moss ha scritto:
   I need to use an Image because i need to be able to get pixel data (ie
  read
   the color values in an image) via Image[x,y].
   I would also like this image to be visible on screen, but the only box
  i've
   found is PictureBox, which uses a picture, and it will not load an
 image.
   (and pictures dont do pic[x,y])
  
   So I'd like to do:
   'PictureBox on form
   Dim i as Image
  
   i = Image.Load(Myfile.jpg)
  
   PicBox1.Picture = i  'this is where error comes obviously as it wants a
   picture, but i need to use images ^_^
  
  May be... picbox1.picture = i.picture? (I didn't try)
 
  Cheers,
 
  --
  Doriano Blengino
 
  Listen twice before you speak.
  This is why we have two ears, but only one mouth.
 
 
  -
  This SF.Net email is sponsored by the Moblin Your Move Developer's
  challenge
  Build the coolest Linux based applications with Moblin SDK  win great
  prizes
  Grand prize is a trip for two to an Open Source event anywhere in the
 world
  http://moblin-contest.org/redirect.php?banner_id=100url=/
  ___
  Gambas-user mailing list
  Gambas-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/gambas-user
 
 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Using an Image in a PictureBox or help with my issue

2008-11-23 Thread Robert Moss
I get a Null Object error, and when i look at Picture.Image's properties in
the IDE, it looks like Image is readonly., even when i do
PicBox.Picture.Image.Load(filename) i get the same Null Object Error.

I've also noticed that you can NOT use the ^ and MOD operators in the same
expression =p

On Sun, Nov 23, 2008 at 1:07 AM, Werner [EMAIL PROTECTED] wrote:

 Robert Moss wrote:
  I need to use an Image because i need to be able to get pixel data (ie
 read
  the color values in an image) via Image[x,y].
  I would also like this image to be visible on screen, but the only box
 i've
  found is PictureBox, which uses a picture, and it will not load an image.
  (and pictures dont do pic[x,y])
 
  So I'd like to do:
  'PictureBox on form
  Dim i as Image
 
  i = Image.Load(Myfile.jpg)
 
  PicBox1.Picture = i  'this is where error comes obviously as it wants a
  picture, but i need to use images ^_^
 
  Message(str(Image[x,y]))
 
  Thanks so much
 

 PicBox1.Picture = i  'this is where error comes obviously as it wants a

 try this:

 PicBox1.Picture.Image = i

 Regards
 Werner


 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Values between forms..

2008-11-08 Thread Robert Moss
in Form1 you could create :

PUBLIC SUB ChangeTextBox(Value as String)
  Text1.Text = Value
END SUB

and in form 2:

PUBLIC SUB Button_Click()
   Form1.ChangeTextBox(form2Textbox.text)
End Sub



On Fri, Nov 7, 2008 at 10:18 AM, Oscar Cascante Fonseca 
[EMAIL PROTECTED] wrote:

 Hi, i am new in gambas..

 I don't find in the archives any post about how to pass values between
 forms.



 Ej:



 Form1 with a textbox control

 Form 2 with a button control



 When you click in Form2.button, the Form1.textbox.text change.



 Could somebody help me?



 Thanks.

 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Socket cuts out before full page is read.

2008-11-07 Thread Robert Moss
First of all I would like to thank all of you for your efforts ^_^ you have
have been a wonderful ally in learning this new language.

I am using the socket control to create a local ui to a web interface.
I create a request that looks like:

GET / HTTP/1.0
Host: www.microsoft.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

and when it reads in the data, it cuts out not even half way thru.

I use this code:

PRIVATE FUNCTION ConnSend(Data AS String) AS String
  DIM sBuf AS String
  DIM i AS Integer 'counter
  DIM sTotal AS String

  sBuf = Data

  ME.Connect(myHTTP.USE_HOST, myHTTP.USE_PORT)  'connects to host:port
  DO WHILE (ME.Status  7) AND (ME.Status  0)
WAIT 0.1
INC i
IF i = 200 THEN
  'Timeout - Bail
  DEBUG Timeout - waiting for connection
  MyClose() 'close and quit
  RETURN 
END IF
  LOOP
  i = 0 'reset counter

  IF ME.Status  7 THEN
DEBUG Error:   ME.Status
MyClose()
RETURN  'ensure we don't go on
  END IF

  WRITE #ME, sBuf, Len(sBuf) 'Writes the get or post headers with cookies
sometimes

  DO WHILE Lof(ME) = 0
WAIT 0.1
INC i
IF i = 200 THEN
  'Timeout - Bail
  DEBUG Timeout - Waiting for reply
  MyClose()
  RETURN  'ensure we don't go on
END IF

  LOOP

  DO WHILE (NOT Eof(ME))
READ #ME, sBuf, Lof(ME)  'I previously just used the standard READ #ME,
sBuf, Lof(ME) by itself, but i thought this might work
sTotal = sBuf
  LOOP

  RETURN sTotal

END

Is there anything I can do?

In the return header, it has

Connection: Close

and no mention of Chunk (data sending)
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas Help - PLEASE - Object Arrays - Need help ASAP

2008-11-07 Thread Robert Moss
OK,   //CODE EXAMPLE AT END OF MSG

I have a subclass of Socket, Which is a socket, but contains some extra
data, so that in the event handler, I have more than just the TAG property
to work with.

It seems that I cannot have a dynamically sized array.

When i try putting:

PUBLIC mySW[] as SWSocket

At  the top of the form class, it says Arrays are forbidden here
And if I declare it like:
Sub Form_Open ()
DIM mySW[] as SWSocket


it says syntax error.

It's requiring me to set an array size, which isn't good, and on top of
that, I cannot access the socket outside of that function (and i believe the
sockets are destroyed once the open sub ends)

I'd like a button on the form that works like this

PUBLIC SUB btnAdd_Click()
mySw[iNextSw] = new SWSocket;
mySw[iNextSw].DoSomeMethod()
INC iNextSw

END

'With a timer that does:

PUBLIC SUB Timer_Tick() 'or whatever it is, not important
DIM X as Integer
FOR X = 0 TO (iNextSw - 1)
mySw[X].SendData
NEXT
END

How can I do this?


-Robert















On Thu, Nov 6, 2008 at 12:36 PM, Doriano Blengino 
[EMAIL PROTECTED] wrote:

 Rob ha scritto:
  On Thursday 06 November 2008 13:37, Doriano Blengino wrote:
 
  i.e., LAST is a reference to the object that raised the event, and you
  can compare it to anything you like (probably widgets).
 
 
  Yes, that should work, but with limitations.  You would have to hardcode
  the name of the control you wish to compare against at compile time.
  Gambas lacks enough introspection at present to obtain a reference to an
  object using its symbol name at run time.  (As far as I know, the same is
  true of VB.)
 
 Gambas does not lack introspection. You can compare LAST.name to a
 string, or LAST to a variable (an instance variable), or even look at
 the type of the object (object.Type(LAST)). The symbol name is a
 reference to the object,
 Mainly, my thought was directed to groups of widgets created at design
 time, where the name (symbol) of the widget/control *is* a reference to
 the object.

  The tag system is another way - sometimes tags are better, sometimes
  control/widget reference is.
 
 
  Agreed.  This will be easier if you have OK and Cancel buttons across
  the bottom of the screen and want to tell which one got pressed, but if
  you have an array of 64 buttons (or text boxes, like one of my clients)
 it
  might be time to start assigning tags at control creation.
 
 If you have a true array, then LAST = btns[0] should work. If you don't
 have an array (ie: for i=0 to 10 bnt = new Button), then you don't
 have any reference to the objects you created, so clearly you can't
 compare to a reference you don't have...
 But note that you don't have to use Tag - you could use Name, Left, or
 whatever differentiates these controls each other. Of course, Tag is
 devoted to such things.

 Regards,
 Doriano




 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Socket cuts out before full page is read.

2008-11-07 Thread Robert Moss
I end my lines with \n but that is not an issue as the remote server is Unix
based. I receive part of the page, actually i receive approx 3,465 bytes.
And the last few bytes are like div id=b   it doesn't even end neatly.

On Fri, Nov 7, 2008 at 6:44 AM, Benoit Minisini 
[EMAIL PROTECTED] wrote:

 On vendredi 7 novembre 2008, Robert Moss wrote:
  First of all I would like to thank all of you for your efforts ^_^ you
 have
  have been a wonderful ally in learning this new language.
 
  I am using the socket control to create a local ui to a web interface.
  I create a request that looks like:
 
  GET / HTTP/1.0
  Host: www.microsoft.com
  User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
 
  and when it reads in the data, it cuts out not even half way thru.
 
  I use this code:
 
  PRIVATE FUNCTION ConnSend(Data AS String) AS String
DIM sBuf AS String
DIM i AS Integer 'counter
DIM sTotal AS String
 
sBuf = Data
 
ME.Connect(myHTTP.USE_HOST, myHTTP.USE_PORT)  'connects to host:port
DO WHILE (ME.Status  7) AND (ME.Status  0)
  WAIT 0.1
  INC i
  IF i = 200 THEN
'Timeout - Bail
DEBUG Timeout - waiting for connection
MyClose() 'close and quit
RETURN 
  END IF
LOOP
i = 0 'reset counter
 
IF ME.Status  7 THEN
  DEBUG Error:   ME.Status
  MyClose()
  RETURN  'ensure we don't go on
END IF
 
WRITE #ME, sBuf, Len(sBuf) 'Writes the get or post headers with cookies
  sometimes
 
DO WHILE Lof(ME) = 0
  WAIT 0.1
  INC i
  IF i = 200 THEN
'Timeout - Bail
DEBUG Timeout - Waiting for reply
MyClose()
RETURN  'ensure we don't go on
  END IF
 
LOOP
 
DO WHILE (NOT Eof(ME))
  READ #ME, sBuf, Lof(ME)  'I previously just used the standard READ
 #ME,
  sBuf, Lof(ME) by itself, but i thought this might work
  sTotal = sBuf
LOOP
 
RETURN sTotal
 
  END
 
  Is there anything I can do?
 
  In the return header, it has
 
  Connection: Close
 
  and no mention of Chunk (data sending)

 Do you end your lines with CR+LF? And not just CR?

 --
 Benoit Minisini

 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Socket cuts out before full page is read.

2008-11-07 Thread Robert Moss
i tried using \r\n and nothing positive happened. i got 3440 bytes, 1 more
byte than previously (recount showed 3439 bytes, i forgot the debug header)

  DO WHILE (NOT Eof(ME))  'This crap isnt working
READ #ME, sBuf, Lof(ME)
sTotal = sBuf
WAIT 1  'I added this line since last message, and after waiting 1
second, i got the error that socket was closed.
  LOOP

Does this look right to you?

POST /process_data.php HTTP/1.0
Host: www.myhost.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
Referer: http://www.myhost.com/index.php
Cookie: remember=mycine;
login=mycine%2B9e6c670bf76e9a2c07a9921c56d3532ecacf2ae5;
toolbar=mycine%2BC%2B75a593a34aa5ba8e5e5788b7c899802e;
Content-Type: application/x-www-form-urlencoded
Content-Length: 99

type=process_datafeedset=0value=red%20appletable=stuffcriteria=exactset_price=340old_price=0



On Fri, Nov 7, 2008 at 6:49 AM, Robert Moss [EMAIL PROTECTED] wrote:

 I end my lines with \n but that is not an issue as the remote server is
 Unix based. I receive part of the page, actually i receive approx 3,465
 bytes.  And the last few bytes are like div id=b   it doesn't even end
 neatly.


 On Fri, Nov 7, 2008 at 6:44 AM, Benoit Minisini 
 [EMAIL PROTECTED] wrote:

 On vendredi 7 novembre 2008, Robert Moss wrote:
  First of all I would like to thank all of you for your efforts ^_^ you
 have
  have been a wonderful ally in learning this new language.
 
  I am using the socket control to create a local ui to a web interface.
  I create a request that looks like:
 
  GET / HTTP/1.0
  Host: www.microsoft.com
  User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
 
  and when it reads in the data, it cuts out not even half way thru.
 
  I use this code:
 
  PRIVATE FUNCTION ConnSend(Data AS String) AS String
DIM sBuf AS String
DIM i AS Integer 'counter
DIM sTotal AS String
 
sBuf = Data
 
ME.Connect(myHTTP.USE_HOST, myHTTP.USE_PORT)  'connects to host:port
DO WHILE (ME.Status  7) AND (ME.Status  0)
  WAIT 0.1
  INC i
  IF i = 200 THEN
'Timeout - Bail
DEBUG Timeout - waiting for connection
MyClose() 'close and quit
RETURN 
  END IF
LOOP
i = 0 'reset counter
 
IF ME.Status  7 THEN
  DEBUG Error:   ME.Status
  MyClose()
  RETURN  'ensure we don't go on
END IF
 
WRITE #ME, sBuf, Len(sBuf) 'Writes the get or post headers with
 cookies
  sometimes
 
DO WHILE Lof(ME) = 0
  WAIT 0.1
  INC i
  IF i = 200 THEN
'Timeout - Bail
DEBUG Timeout - Waiting for reply
MyClose()
RETURN  'ensure we don't go on
  END IF
 
LOOP
 
DO WHILE (NOT Eof(ME))
  READ #ME, sBuf, Lof(ME)  'I previously just used the standard READ
 #ME,
  sBuf, Lof(ME) by itself, but i thought this might work
  sTotal = sBuf
LOOP
 
RETURN sTotal
 
  END
 
  Is there anything I can do?
 
  In the return header, it has
 
  Connection: Close
 
  and no mention of Chunk (data sending)

 Do you end your lines with CR+LF? And not just CR?

 --
 Benoit Minisini

 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the
 world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] InputBox with GTK... Terribly Cramped?

2008-11-07 Thread Robert Moss
Running gambas 2.8, GTK project.
When I create an input box, the textbox is about 2 characters wide, the OK
and Cancel buttons are stacked right on top of each other, the prompt is
squished in the top left corner, and the title gets cut off:

eg:

---
| This is my t... [x]|

|  Hi p [   OK ]
|  lz ty [   CANCEL]
|  pe y
|[]  -- thats all the text you can see

is this just a bug?
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Gambas Help - PLEASE - Object Arrays - Need help ASAP

2008-11-06 Thread Robert Moss
Hello, I am fairly new to GAMBAS but a experienced in C++ and VB 6. I am
trying to create an array of sockets, so that I can maintain a dynamic
number of connections, and use the same code for each.

I've been struggling for HOURS searching for the answer on google, and
trying as much different code as I can think of, experimenting, but to no
avail. I can create the objects, but I can't figure out how to receive
messages from them (actually I can't figure out how to distinguish them).

A simpler example with buttons: This works, but I need to know WHICH
button fired the event,

PUBLIC SUB Form_Open()

  DIM btns[2] AS Button

  btns[0] = NEW Button(FMain) AS btns

  btns[0].Caption = Test
  btns[0].Left = 50
  btns[0].Top = 50
  btns[0].Show

  btns[1] = NEW Button(FMain) AS btns

  btns[1].Caption = Test 2
  btns[1].Left = 150
  btns[1].Top = 50

  btns[1].Show

END

PUBLIC SUB btns_Click()
  Message.Info(augh: )
END
' using PUBLIC SUB btns_Click(Index as Integer) doesnt work
' nor does   PUBLIC SUB btns[key]_Click()

'also, using the current function, I tried maybe Message.Info(ID:  
btns.Id) or ANYTHING

This functionality is CRUCIAL please help asap.

-Robert
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas Help - PLEASE - Object Arrays - Need help ASAP

2008-11-06 Thread Robert Moss
Ok, awesome. But what is a control group and how do I use one? I can't find
any documentation on it

On Thu, Nov 6, 2008 at 4:16 AM, Stefano Palmeri [EMAIL PROTECTED]wrote:

 Il giovedì 6 novembre 2008 13:05:42 Robert Moss ha scritto:
  Hello, I am fairly new to GAMBAS but a experienced in C++ and VB 6. I am
  trying to create an array of sockets, so that I can maintain a dynamic
  number of connections, and use the same code for each.
 
  I've been struggling for HOURS searching for the answer on google, and
  trying as much different code as I can think of, experimenting, but to no
  avail. I can create the objects, but I can't figure out how to receive
  messages from them (actually I can't figure out how to distinguish them).
 
  A simpler example with buttons: This works, but I need to know WHICH
  button fired the event,
 
  PUBLIC SUB Form_Open()
 
DIM btns[2] AS Button
 
btns[0] = NEW Button(FMain) AS btns
 
btns[0].Caption = Test
btns[0].Left = 50
btns[0].Top = 50
btns[0].Show
 
btns[1] = NEW Button(FMain) AS btns
 
btns[1].Caption = Test 2
btns[1].Left = 150
btns[1].Top = 50
 
btns[1].Show
 
  END
 
  PUBLIC SUB btns_Click()
Message.Info(augh: )
  END
  ' using PUBLIC SUB btns_Click(Index as Integer) doesnt work
  ' nor does   PUBLIC SUB btns[key]_Click()
 
  'also, using the current function, I tried maybe Message.Info(ID:  
  btns.Id) or ANYTHING
 
  This functionality is CRUCIAL please help asap.
 
  -Robert
  -
  This SF.Net email is sponsored by the Moblin Your Move Developer's
  challenge Build the coolest Linux based applications with Moblin SDK 
 win
  great prizes Grand prize is a trip for two to an Open Source event
 anywhere
  in the world http://moblin-contest.org/redirect.php?banner_id=100url=/
  ___
  Gambas-user mailing list
  Gambas-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/gambas-user
 PUBLIC SUB btns_Click()

Message.Info(augh: )

 PRINT LAST.Caption

 END


 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user