Can't save the 'Get Text' as a variable in the very first lesson; 'returnText' is not declared


#1

I’m getting the following error:

Compiler error(s) encountered processing expression “returnText”. ‘returnText’ is not declared. It may be inaccessible due to its protection level.

I tried deleting it and starting again but I got the same error. Why is this happening? Thanks.


#2

Create the variable first then assign it to the get text activity


#3

Hi, I tried this but got the error

Invalid L-value expression.:Reference expressions cannot end with Conversion. The provided expression’s type must exactly match the type T of VisualBasicReference or LambdaReference.


#4

delete get text activity, create string variable of returnText and add get text activity in flow assign the variable to it.

Don’t create the variable using Ctrl+T as it will create it as generic type.


#5

Hi, tried this and got a new error:


#6

Remove the default value and try again


#7

Tried this, still getting the same error


#8

change variable type of returnText to Generic … check if you are still getting the same error


#9

basically if it is generic value you can not store it in string and vice versa.

Here I am using output random string in both the get text:

When I assign string variable for the 1st time to Get Text activity after dragging it in the sequence it will accept output as string only and if I assign genericValue for the first time to Get Text as output variable type then it will not accept string.


#10

Is there a solution to this?
I am getting the exact same compile error which I cant get rid even if I change variable type to GenericValue or string.


#11

Hello everyone,

A way that worked for me is doing the next thing:

  1. Delete the steps with getText and messageBox from the “Do” sequence
  2. Select the “Do” Sequence (as a visual indicator that the right window is selected, you will see it with a different border - also i’ve attached a picture at the bottom)
  3. Click on Create variable -> name it returnText (do not change anything else)
  4. add the messageBox widget
  5. add the getText widget between the clickAccept widget and messageBox widget
  6. proceed as instructed in the video and complete the getText actions (now you should also have autocomplete in the Value text on the right side of the screen
  7. proceed as instructed in the video for the message box widget (now you should also have autocomplete for the part after the +)

I don’t understand this framework completely but doing the exact above steps fixed the problem for me. I encountered all the issues mentioned above while trying something different as suggested by the other members. Maybe it’s a bug in the framework :slight_smile: