We help IT Professionals succeed at work.

How do I build an array from database fields?

418 Views
Last Modified: 2013-12-18
I'm urgently seeking a tutorial that will give me a mid-level knowledge of using arrays in Crystal.  What I need immediately is something to guide me through assigning values from a database field to a specific location in an array that is initialized with four blank elements.  If database field = 'PRINT' then Array [1] := 'PRINT' else (leave Array [1] blank).  If database field = 'FAX' then Array [2] := 'FAX' else (leave Array [2] blank).  And so on.

Thanking you in advance,

BC
Comment
Watch Question

Sr Software Engineer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
DVZ,

If I go the way of the 1st example, I then get a string variable that might look like ('PRINT','{blank}','{blank}','FAX').  Right?

Is this literally an array? Or is it just a string?   How do I examine element [1, 2, 3 or 4] to see what's in it (which is what I need the array for)?  If stringvar[1] = 'PRINT' then thus and so?

Thanks,

Pelican45  
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.