Array Variables - Error

Hi Friends,

I am getting error in the array variables that was given in the practise problem however the solution states the same as below : Error ERROR Validation Error Compiler error(s) encountered processing expression "NameAge(0) + " " + NameAge(1) + " " +NameAge(2) + " “”.(2) : error BC30574: Option Strict On disallows late binding.
(2) : error BC30574: Option Strict On disallows late binding.
(2) : error BC30574: Option Strict On disallows late binding. ArrayVar_030123.xaml

Please help me in fixing this error asap.

Thankyou,
Srivennila A

Hi,

What type is NameAge variable?

For now ,can you try the following expression?

NameAge(0).ToString + " " + NameAge(1).ToString + " " +NameAge(2).ToString + " "

Regards,

1 Like

@Sri_Vennila

The error says you need to specify a type for the variable…as you are using + the value before it and after it should be of same type…so we have to convert them to string

NameAge(0).ToString + " " + NameAge(1).ToString + " " + NameAge(2).ToString + " "

This will give a string output will all the values joined with space

Alternately you can join like this as well

String.Joint(" ",NameAge)

Cheers

1 Like

Thankyou so much. Error rectified as the variable type is of array of strings
like this String (String of Array)instead just String or Array.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.