darkside
Replies to this thread:

More by darkside
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 vb 6 help!!!
[VIEWED 5007 TIMES]
SAVE! for ease of future access.
Posted on 07-18-07 8:34 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Can you guys plz help me on this....
i need to convert any text and number of textbox1 in reverse in textbox2
but my problem is i need to convert numeric in english word.
for example:
user input textbox1 = abc123
output on textbox2 should be threetwoonecba
any help will be appriciated!!!

thank you in advance
 
Posted on 07-19-07 8:16 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Here how U can do it.
Create a table where you will store world for the numbers (0 to 9).
Then use the reverse function. When ever you hit the number go to the table and convert it.

It will work for sure.

GOOD luck
 
Posted on 07-19-07 10:14 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

first of all put the letter in for loop, something like

for i = len(InPut) to 1 step -1
then use RIGHT function to extract the last letter
use if statement, if letter = 1 then "One" -- I think u can use REPLACE function as well
concatenate and accumulate it in a output variable
next i

I don't really know VB that well, but giving you a logic. THere could be tons of other logic to accomplish this.

Goodluck
 
Posted on 07-19-07 12:17 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

HERE IS how I did with sql procedure.
I guess the logic is the same for VB as well. CHECK IT OUT.
--********
-- table to hold number and word for 0-9
Create table dbo.bsNtoT
(Num int,
Word varchar(20)
)

--insert script for lookup table
insert into dbo.bsNtoT values (0,'zero')
insert into dbo.bsNtoT values (1,'one')
insert into dbo.bsNtoT values (2,'two')
insert into dbo.bsNtoT values (3,'three')
insert into dbo.bsNtoT values (4,'four')
insert into dbo.bsNtoT values (5,'five')
insert into dbo.bsNtoT values (6,'six')
insert into dbo.bsNtoT values (7,'seven')
insert into dbo.bsNtoT values (8,'eight')
insert into dbo.bsNtoT values (9,'nine')

--Create procedure do the job
ALTER procedure bsReverse
(
@input varchar(20)
)
as
begin
Declare @i int, @Count int, @iLen int
Declare @NewText varchar(10), @Text varchar(10), @FinalText varchar(100), @check char(1)
set @i=1
SET @FinalText=''
SELECT @Count=len(@input)
SELECT @iLen=@Count
WHILE @i<=@Count
begin
SELECT @NewText=substring(@input,@iLen,1)
SELECT @check= isnumeric(@NewText)
if @check='1'
SELECT @NewText=Word FROM dbo.bsNtoT WHERE Num=@NewText

SELECT @FinalText=@FinalText+@NewText
SET @i=@i+1
SET @iLen=@iLen-1
end

SELECT @FinalText
end


--try running it
exec bsReverse 'ab45c'


--********
 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 90 days
Recommended Popular Threads Controvertial Threads
TPS To F-1 COS
TPS to F1 Status.
Nepal TPS has been Extended !!!
Got my F1 reinstatement approved within 3 months(was out of F1 for almost 2 years)
ICE kidnapping people off the streets over op eds
#MAGA#FAFO is delicious
TPS of Nepal to be automatically extended for 6 months based on South Sudan decision
Nepal TPS decision
Has anyone here successfully reinstated to F-1 status after a year-long gap following a drop from F-1?
US citizen Petitioning my wife who was out of status when she was in H1B. What to do ?
TPS Sakiyo Tara Case is in Court.
Supreme Court allows Trump to end TPS for Venezuelans
Genuine Question.... Why so many folks still in TPS after 10 years. Is the statistics wrong?
Any input on remote jobs(IT related or Sales or Marketing)?
Nepal Likely to Get 60-Day TPS Notice
मुद्दा हाल्छन होला र ?
TPS cancel bho bhane k garne?
नेपाल मा B. sc गरियो यहाँ फेरी ७० -८० क्रेडिट पढ्नु पर्ने भो
EAD HELP NEEDED URGENTLY!
Don’t Just Read—Join the Conversation
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters