CONSTANTS for array-boundary

I want program like in other languages usual.
I want define a constant, and the array should so big like the constant.

Example
    integer MAX_NAME = 16
    string ls_names[MAX_NAME]

This is normaly in PB7 not possible !?
Do you know any other solution,
except an array-definition without boundary-limits (  string ls_names[]
)


Peter Stojkovic



0
Peter
4/24/2001 11:37:06 AM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

3 Replies
343 Views

Similar Articles

[PageSpeed] 26

Did you try:

constant integer MAX_NAME = 16
string ls_names[MAX_NAME]


"Peter M. Stojkovic" <Peter.Stojkovic@SMS-Eumuco.de> wrote in message
news:3AE56561.C65795AB@SMS-Eumuco.de...
> I want program like in other languages usual.
> I want define a constant, and the array should so big like the constant.
>
> Example
>     integer MAX_NAME = 16
>     string ls_names[MAX_NAME]
>
> This is normaly in PB7 not possible !?
> Do you know any other solution,
> except an array-definition without boundary-limits (  string ls_names[]
> )
>
>
> Peter Stojkovic
>
>
>


0
Brian
4/24/2001 12:10:08 PM
This example generates a syntax-Error: C00031
Has anyone another solution ??

Peter




Brian Dick wrote:

> Did you try:
>
> constant integer MAX_NAME = 16
> string ls_names[MAX_NAME]
>
> "Peter M. Stojkovic" <Peter.Stojkovic@SMS-Eumuco.de> wrote in message
> news:3AE56561.C65795AB@SMS-Eumuco.de...
> > I want program like in other languages usual.
> > I want define a constant, and the array should so big like the constant.
> >
> > Example
> >     integer MAX_NAME = 16
> >     string ls_names[MAX_NAME]
> >
> > This is normaly in PB7 not possible !?
> > Do you know any other solution,
> > except an array-definition without boundary-limits (  string ls_names[]
> > )
> >
> >
> > Peter Stojkovic
> >
> >
> >

0
Peter
4/25/2001 11:40:18 AM
Constant values as array dimentions are not supported in PowerScript. The
following is a workaround.

constant integer MAX_NAME = 16
string ls_names[]

ls_names[MAX_NAME] = <somevalue>    // allocates MAX_NAME elemensts

--
<hopethishelps />
Roy Kiesler [TeamSybase]
mySybase -- http://my.sybase.com

"Peter M. Stojkovic" <Peter.Stojkovic@SMS-Eumuco.de> wrote in message
news:3AE6B7A2.76A242A8@SMS-Eumuco.de...
> This example generates a syntax-Error: C00031
> Has anyone another solution ??
>
> Peter
>
>
>
>
> Brian Dick wrote:
>
> > Did you try:
> >
> > constant integer MAX_NAME = 16
> > string ls_names[MAX_NAME]
> >
> > "Peter M. Stojkovic" <Peter.Stojkovic@SMS-Eumuco.de> wrote in message
> > news:3AE56561.C65795AB@SMS-Eumuco.de...
> > > I want program like in other languages usual.
> > > I want define a constant, and the array should so big like the
constant.
> > >
> > > Example
> > >     integer MAX_NAME = 16
> > >     string ls_names[MAX_NAME]
> > >
> > > This is normaly in PB7 not possible !?
> > > Do you know any other solution,
> > > except an array-definition without boundary-limits (  string
ls_names[]
> > > )
> > >
> > >
> > > Peter Stojkovic
> > >
> > >
> > >
>


0
Roy
4/25/2001 3:47:55 PM
Reply:

Similar Artilces:

Constant array or array of constant?
I was reading through E6 again, and noticed something a little troubling: sub part (*@_ is rw) {...} Well, I<of course> @_ C<is rw>! Otherwise we wouldn't be able to C<shift> things off of it. What was actually meant, I presume, is: sub part (*@_ of (Object is rw)) {...} #[1] Or something. Basically, it's not the array that's read-only by default, it's the elements. I figure this would be a common thing to declare, so, hey!, how about a new keyword? C<a are b> as an alias for C<a of (Object is b)>. sub foo(@x...

Arrays, Arrays, Arrays
I mainly come from a JScript classic ASP background and I'm liking both C#.net and JScript.net. Now I have to say... "What's happened to arrays?" They used to be so flexible and easy to use. Here are my quick questions... Am I allowed to create an array with a non specified length so that I can add to it? If not then how can I modify an array's length? Can I create an array with a named index eg myArray["apple"] = "tasty"; or is the hash table the equivalent for this now? The classic array methods and properties like pop(), push(), length etc... are ...

Powerbuilder and database array fetching / array inserts
What I understand from the documentation, Powerbuilder supports array fetching when you issue a SELECT query. The size of this "array" can be changed by setting the DBParm parameter BLOCK (we have an Oracle db) But what about array inserts? Does Powerbuilder support this if you are using bindvariables? I mean, if you have a datawindow (rows with NewModified! status), does the dw.Update() then produce one Insert command and send all the inserted values in an array to the database, or (what I suspect) will there be an insert command (sent over the network) for every row in th...

Concatenating arrays from arrays of arrays
Hello - I am trying to accumulate items in a flat list (array) by concatenating on to it the scalars contained in arrays which in turn are contained in arrays. The data is to be read in from a file rather than existing as literals in my code. Everything I try either crashes the computer or gives me an array of arrays instead of a flat list. I have been programming in Unicon which has a concatenate operator, but Perl makes very heavy weather of nested list management. Should I switch to Lisp, or is there a way of doing what I want to do in Perl? Regards _John Sampson_ On...

referring to an array in an array of arrays
How can I get at an array in an array of arrays? I'm creating the arrays using: $fComments[$i++] = [ @comments ]; Now I want to get back what I put in: print "$fComments[0]\n"; but this prints ARRAY(0x107671f0). How do I follow that pointer? (I really think we need a pre-beginners list... =) TIA. - B You can try something like this: print "@{$fComments[0]}\n"; Which will attempt to dereference the array at $fComments[0]. -----Original Message----- From: Bryan R Harris [mailto:Bryan_R_Harris@raytheon.com] Sent: Tue...

How to unshift to an array in an array of arrays?
How to unshift to an array in an array of arrays? > -----Original Message----- > From: Angerstein [mailto:ang@nmc-m.dtag.de] > Sent: Wednesday, August 28, 2002 6:12 AM > To: beginners@perl.org > Subject: How to unshift to an array in an array of arrays? > > > How to unshift to an array in an array of arrays? $ perl -d -e 1 ..... DB<1> @aoa = ([qw(foo bar baz)]) << create array of arrays DB<2> x @aoa 0 ARRAY(0x80f82dc) 0 'foo' 1 'bar' 2 'baz' DB<3> unshift @{$aoa[0]}, 'qu...

Array of arrays
Hi I'm trying to return from a web service a array of arrays, one of the arrays is a array of objects, which I tested separately and it's working fine, and another array of integer and another of strings. When I run the web service I got this:You must implement a default accessor on System.Array because it inherits from ICollectionDefault accessor what that means? Thank you very much.  As Heinlein said "specialization is for insects" explore beyond the universe. Could you pls post the relevant code ? hi rushan thank you for the reply the code is here:  ...

Constants and arrays
This is really more of a curiosity question, but it is something that irks me about PowerBuilder... What was Sybase's reasoning behind not allowing array declarations using constants? It totally defeats one of the more prime purposes (IMHO) of using constants in the first place. What is so darn hard about evaluating the following declarations: constant int MAX_ARRAY = 12 string ls_array[MAX_ARRAY] When PB can properly evaluate the following declaration-and-initialization: constant int TEST1 = 4 constant int TEST2 = 8 int li_test3 = TEST1 + TEST2 Every programming bo...

An array of arrays
Could anybody help me out here? Here's the message I just got from a guy I know: ----------- I was wondering if you know how to create and access an array of arrays in Perl. Basically I'm parsing an exported text file containing e-mails and I think I want to move some fields into arrays until I'm ready to do my report. Here basically is what I'm looking at doing: ^ | | Array 1 (messages) | | v <------ Array 2 -------> (message fields:FROM, TO, CC, etc, sensitivity, etc) I want to be able to search through the first array to count how many messag...

Array of Array.
How is possible to declare a DYNAMIC array of array ? I need something like a dynamic hash table whose pages grow up dynamically too (each one can have different number of elements). In other words, a matrix that can be dynamic in both dimension. example: [1,2,3...] [3,4..] [5] [6,7,8,9...] [.] .. .. .. Have you considered using a DataStore? -- <hopethishelps/> Roy Kiesler [TeamSybase] SDN CodeXchange -- http://codexchange.sybase.com "Marco Meoni - News" <mmeoni@usl4.toscana.it> wrote in message news:401ba036$1@forums-2-dub... > How ...

Array constants
Hi, Am I missing something, or shouldn't this be perfectly legal? (D2005) {code} const VALUES: array[1..3] of integer = ( 1000, 2000, 3000 ); DEFAULT_B = VALUES[1]; // Error {code} The reported error is: [Error] Unit1.pas(33): E2026 Constant expression expected Tom "Tom Brunberg" <nospam@to.me> wrote in message news:89316@forums.codegear.com... > Am I missing something, or shouldn't this be perfectly legal? > (D2005) > {code} > const > VALUES: array[1..3] of integer = (1000, 2000, 3000); > DEFAULT_B = VAL...

Array of Arrays
Hi, I am looking for a way to create an array of arrays which needs to be passed to Oracle database to minimize the round trips to hte server. I was successful in sending simple arrays so far but no idea on how to create array of arrays in PB. I have used structures to simulate this but looks like I can't send the structure to Oracle. Anyone has any suggestions? Thanks, Anil Please don't cross-post. On 3 Mar 2005 14:02:47 -0800, Anil wrote: >Hi, > >I am looking for a way to create an array of arrays which >needs to be passed to Oracle database t...

array of arrays
Hi. =20 Im using a multidimensional array in the following way: $array[$i][$j][$k] =3D [ @list ]; where, @list is a 2-D array ie. = $list[][]. How do I access the individual elements of the array @list once Ive put it = into the array @array? Thanks. -ty On Thu, Oct 18, 2001 at 02:28:41PM -0600, Tyler Cruickshank wrote: > $array[$i][$j][$k] = [ @list ]; where, @list is a 2-D array ie. $list[][]. > > How do I access the individual elements of the array @list once Ive put it > into the array @array? $array[$i][$j][$k][$l][$m] eq $list[$l][$m] Howev...

array of arrays
Hi, I have a simple question: how do I access an array in an array? @array = (@array1, array2); ### unless this is wrong... the idea behind it is, that I have a long list, and want to put all 25 entries in a seperate array in that big array. later on I want to be able to read one specific array at a certain position... -- cheers alex mailto:Keex@gmx.de you need to learn about references. read the: perldoc perllol here is the jist though. @all = (\@array1, \@array2 ... ); # ... so on to access first array and first element...

Web resources about - CONSTANTS for array-boundary - sybase.powerbuilder.general

Resources last updated: 1/22/2016 10:43:54 PM