On Sat, 24 Dec 2016 11:05:00 +0100
Benoît Minisini wrote:
> Le 24/12/2016 à 09:44, Fabien Bodard a écrit :
> > Public Sub Main()
> >
> > Dim s As String
> > Dim i As String
> > Dim a As New Integer[]
> > ''1) with no knowledge of the number of values
> > 'init the string
> > s = "[12,
An elegant solution, one just has to love the Gambas language!
a.Add(i) is the part I overlooked, it takes a while to change one's old habits.
To all, have a Great Christmas. In this part of South Africa there is a
heatwave with temperatures into the high thirties for Christmas.
On 24/12/2016, B
Le 24/12/2016 à 09:44, Fabien Bodard a écrit :
> Public Sub Main()
>
> Dim s As String
> Dim i As String
> Dim a As New Integer[]
> ''1) with no knowledge of the number of values
> 'init the string
> s = "[12,32,3]"
>
> 'remove unused spaces and braquets
> For Each i In Split(Left(R
Public Sub Main()
Dim s As String
Dim i As String
Dim a As New Integer[]
''1) with no knowledge of the number of values
'init the string
s = "[12,32,3]"
'remove unused spaces and braquets
For Each i In Split(Left(Right(Trim(s), -1), -1))
a.Add(i)
Next
'display the arr
Baffled!
I have a string, like "[1,3]", that I want to populate an integer array from.
How to?
tia
--
B Bruen
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based develop
..try:
qrg_i = CInteger(Val(qrg))
Lun 27/1/14, Dirk ha scritto:
Oggetto: Re: [Gambas-user] Convert string to integer
A: gambas-user@lists.sourceforge.net
Data: Lunedì 27 gennaio 2014, 18:11
Hi,
I'm having a problem with Co
You can't use CInteger on a String that does not represent an Integer!
Either make sure your String is always a 'pure' integer... so "14160" in
place of "14160.0"
Or code qrg_i = Int(CFloat(qrg)), which is much more forgiving.
The reason you get an error is that you make the same mistake twice.
Hi,
I'm having a problem with Convert string to integer
Public Sub MySock_Read() ' Data via Telnet
' When some data arrives from the remote
' part of the socket, "DataAvailable" event
' is raised
'
Dim qrg_i As Integer
Dim qrg As String
Dim rx,
What is in qrg at the time you try to do the CInteger call?
Kind regards,
Caveat
On 26/01/14 08:35, Dirk wrote:
> Hi,
>
> I'm having a problem with Convert string to integer
>
>
> where is my mistake? I get error message:
> Type incompatibility expected integer, instead get string
>
>
> Public Su
On Sun, 2014-01-26 at 08:35 +0100, Dirk wrote:
> Hi,
>
> I'm having a problem with Convert string to integer
>
>
> where is my mistake? I get error message:
> Type incompatibility expected integer, instead get string
>
>
> Public Sub MySock_Read()
>
> '***
Hi,
I'm having a problem with Convert string to integer
where is my mistake? I get error message:
Type incompatibility expected integer, instead get string
Public Sub MySock_Read()
'
''*
Hi Tobias
I'm sorry if I haven't completely understood your request (perhaps
you're asking Benoit for a function built in to Gambas?) but I have here
some code I wrote to help me do arbitrary conversions of a number in any
base to any other base (well up to base 36 anyway... then I ran out of
digi
oops,
make this comma in the for loop head a semicolon...
> /*
>* STR: I string containing symbols
>* AL: I alphabet to put symbols in order
>* RET: O result in integer format
>* return value: O number of symbols put into the integer
>*/
> char stoi_
hi,
i haven't found any function to convert a string to an integer with this
string containing signs of an arbitrary number base. won't it be useful?
this is a piece of code i once wrote for this purpose in c:
/*
* STR: I string containing symbols
* AL: I alphabet to put s
14 matches
Mail list logo