[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] array printing challenge



I'm not sure if will help entirely, but I don't believe you should have
a comma between the "80" and "2" on your wrap command.

Jon

-----Original Message-----
From: sqr-users-bounces+jalsager=isif.state.id.us@sqrug.org
[mailto:sqr-users-bounces+jalsager=isif.state.id.us@sqrug.org] On Behalf
Of Anya Mendenhall
Sent: Wednesday, January 18, 2006 12:45 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] array printing challenge



Array challenge

Ok, I am not sure if this is possible in SQR. I have an array of 
students that can store up to 16 names. I have defined my array as 
follows:

create-array name=instr_arr size=100  field=last_name:char

When I put values into my array, I actually concatenate students  name 
along with a | and a certain indicator. So a value in my array might 
look like this:

Liang|Y|
Jenn Doe|Y| Anna Smith|Y
Todd Bond|Y| Joe Shmoe| 

The problem is that when I print out this array and the array has a lot 
of names in it, the names wrap so that one part of the name is on one 
line and the other part of the name is on the other line. Here is an 
example:

                   Gallo|Y| Sarrafzdeh| Medghalchi| Swan| Shibata| 
Daryabandari| Turkkan| Almarmoom| Liebes| Alhussaini| Bush| Vande
rhoek| Almidfa| Khan| Ahmadi-Sabet|

Do you see  how Vanderhoek wraps around? How do I go about it? I need 
to figure out if I am at the end of the line and go to the next? I 
tried the wrap command, but it does not work, as I get the following 
error:

Error on line 287:
   (SQR 5304) Qualifier 'wrap' requires a numeric literal, variable, or 
column.
      print $instr_name (,+1) wrap 80, 2

Here is my code:

while #ind < {maxArraySize}
    let $instr_name = instr_arr.last_name(#ind)

    if ($flag = 'N')
      print $instr_name (,4,15)
    else
      print $instr_name (,+1) wrap 80, 2 - this wrap command does not 
work
    end-if

    let $flag = 'Y'
    add 1 to #ind

  end-while
 

Any ideas on how to go about this? Thank you!
********************************************        
  Anya Mendenhall
  Enterprise Resource Planning Developer   
  Information Systems & Services
  The George Washington University
  44983 Knoll Square, Ste 380,
  Ashburn, Virginia 20147
  Tel No: 703-726-1970
  Fax No: 202-994-5251
********************************************         


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users