#mid$ like function in C
15-Apr-88 00:46:54
Sb: #119309-#mid$ like function in C
Fm: John Draper 76703,4322
To: Vic Wagner 76046,3004
Vic,
I don't know what Basic Rick was talking about. I've never seen one that
would allow MID$ on the left side of an assignment.
At any rate, I don't see a problemimplementing it in C if it isn't allowed
on the left side. The syntax I've seen has always been as a function, (a true
function), and the result is assigned to the lvalue.
a$ = mid$(x$,3,4)
If a temporary buffer is created to handle the intermediate storage
requirements, it would be up to the function to deallocate the memory if
necessary. You could probably even use the stack for intermediate storage,
and of course the requirement of the trailing zero would be handled by simply
plugging one in after the resultant string.
-larry