330
Views
10
Comments
Solved
current row number 0
Question

Hi Guys,

this might be a easy one but somehow I did not get the trigger... 

I am using a mobile app to scan barcodes to a list. The user shall know the amount of scanned barcodes. therefore I use CurrentRowNumber in a "Numbers Badge". But this starts with row 0. Is there a possibility to start counting with row 1? Actually it is row 1...

Thanks! 

Tobias

Rank: #3836
Solution

Hi Guys,

I using a local variable and a list in my mobile app. 


Barcode.Current + " " + Barcode.CurrentRowNumber + 1

is how I did it. 

And the solution is:


Barcode.Current + " " + (Barcode.CurrentRowNumber + 1)

7 grade mathmatics I guess... Thanks for your help guys!


Talking about mathmatics and logic. I am pretty sure that having the first row as row 0 is wrong and I don´t understand this logic of Outsystems...


Tobias 

mvp_badge
MVP
Rank: #24

By design, the first row number is always 0. What you can do is to display CurrentRowNumber + 1. ;)

Rank: #3836

Hi Joao,

thanks for replying on the weekend!

Using CurrentRowNo + 1 makes it 01, 11, 21, etc...

Best regs

Tobias 

mvp_badge
MVP
Rank: #24

You're using CurrentRowNumber property from a TableRecords, right?

Please post details of how you're coming to this result...

Rank: #3836
Solution

Hi Guys,

I using a local variable and a list in my mobile app. 


Barcode.Current + " " + Barcode.CurrentRowNumber + 1

is how I did it. 

And the solution is:


Barcode.Current + " " + (Barcode.CurrentRowNumber + 1)

7 grade mathmatics I guess... Thanks for your help guys!


Talking about mathmatics and logic. I am pretty sure that having the first row as row 0 is wrong and I don´t understand this logic of Outsystems...


Tobias 

mvp_badge
MVP
Rank: #18

Old school basic and VBA are 1 based I think. But most languages I have programmed in over 40 years are zero based.

mvp_badge
MVP
Rank: #18

Eduardo,

Ha this discussion has no longer to do with OutSystems, but you are right, you can use the 'Option Base' statement both in VBBasic6 and VBA, it defaults to zero.

Option Base 0

or 

Option Base 1
Rank: #26143