![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Trying 2 Understand Get Command and Array Topic Summary: Created On: 8-Oct-2006 19:46 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Doh! I wish Telelogic spend more time in the future to beef up their documentation. I figured out what I did after banging my head against the desk. Array should be declared at least (1,1) such as below quote: | |
![]() |
|
Hi -
I wrote this small program, and I expect it to print 5 but instead it prints 0. Can someone explain to me why? Here is the code: quote: Thanks, ------------------------- pete.kowalski(at)motorola.com |
|
![]() |
|
![]() |
|
Doh! I wish Telelogic spend more time in the future to beef up their documentation.
I figured out what I did after banging my head against the desk. Array should be declared at least (1,1) such as below quote: ------------------------- pete.kowalski(at)motorola.com |
|
![]() |
|
![]() |
|
The documentation clearly says that the create command is just the initial size of the array. If you insert into a position that doesn't exist, that position is created.
I notice that your new script doesn't do it correctly either. Array indexing is origin zero. You create an array of size 1x1; well the coordinates of that position are 0x0. When you insert into position 1x1 then the array is now size of 2x2. I notice in your original snippette that you spelled 'aNumber' as 'aNuber' in the 3rd line. Surprised that didn't give DXL errors but perhaps you have auto declare on. - Louie |
|
![]() |
|
![]() |
|
Louie,
Thanks for your tips again. I swear there is a misprint in my Telelogic documentation. Once I find a scanner here I will post it just to prove to myself I don't need glasses. With my original code, I mistyped the variable "aNumber" but corrected it in my second post. That is why no DXL error was generated, and I always have auto declare off. I learned the hard way. Thanks again, ------------------------- pete.kowalski(at)motorola.com |
|
![]() |
|
![]() |
|
instead of scanner you can use digital camera ;-) (just kidding....)
Once I was trying to extract the forum posts in order to create a handy searchable dxl documentation (specially for offline use)... sometimes I found forum explanation is better than dxl documentation... but I gave up!! :-( greetings to all.... Rony |
|
![]() |
|
![]() |
|
I second this.
OR, I look at other people's code to learn how it "should" be done. ------------------------- pete.kowalski(at)motorola.com |
|
![]() |
|
![]() |
|
quote: ... make that 'could' or 'might successfully' and I'll agree! A bit off topic, but... Have you read Jack Ganssle's latest Muse (latest is 134, which isn't in the back-list yet)? He talks there about how one has to read loads of books for a literature major, or loads of manuscripts (music!) for a music major, but for a computing major, it's "Here's how a for loop works. Go write code". We should ALL be reading code to see how it 'could' be done. Paul. ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive |
|
![]() |
|
![]() |
|
More importantly ... we should all be WRITING code some someone ELSE can read it, so THEY can see how it 'could' be done. That notion seems to be missing from many modern languages and code that I've seen, where the language offers myriads of options to do the same thing, and coders gleefully see how cleverly they can code their modules with a view towards reducing the total number of lines and total number of bytes of code and increasing the apparent chaos of the code, making the code effectively write-only.
- Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Trying 2 Understand Get Command and Array
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.