Right and Right$ functions in VB6 - TechRepublic
General discussion
September 30, 2002 at 02:59 AM
setivi

Right and Right$ functions in VB6

by setivi . Updated 23 years, 9 months ago

Dim sText As String
Dim sVal As String
sText = “Test Value”
sVal = Right$(sText,4)

The code above blows up at sVal with these messages:
1. Type declaration does not match declared data type and
2. Compile error. Expected array.

Theerror goes away if I substitute Left in place of Right. What am I doing wrong?
An inventory app is blowing up. Please help.

This discussion is locked

All Comments