Solved

Strptr Example

Posted on 1998-08-09
1
440 Views
Last Modified: 2008-02-01
How can I access each character in string, I see a undocumented feature called strptr in VB 5.0.  How about a good example.
0
Comment
Question by:wesjon
1 Comment
 
LVL 2

Accepted Solution

by:
percosolator earned 20 total points
Comment Utility
Didn't know about the StrPtr.  Looks to be that that function returns a memory address for the string.

You want to use a string function called "Mid$"

Example:
-----------------------------------

Sub LoopStr(S as String)

   Dim I as Integer

   For I = 1 To Len(S)

      MsgBox Mid$(S, I, 1)

   Next I

End Sub
-------------------------------

This routine iterates through each character in the string, and MsgBox's it to you, one at a time.

If you need more clarification, let me know.

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now