[Show all top banners]

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 3507 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 365 days
Recommended Popular Threads Controvertial Threads
शीर्षक जे पनि हुन सक्छ।
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
What are your first memories of when Nepal Television Began?
Sajha Poll: नेपालका सबैभन्दा आकर्षक महिला को हुन्?
ChatSansar.com Naya Nepal Chat
NRN card pros and cons?
TPS Re-registration case still pending ..
Basnet or Basnyat ??
TPS Re-registration
निगुरो थाहा छ ??
Nas and The Bokas: Coming to a Night Club near you
Toilet paper or water?
Anybody gotten the TPS EAD extension alert notice (i797) thing? online or via post?
अमेरिकामा छोरा हराएको सूचना
ढ्याउ गर्दा दसैँको खसी गनाउच
Sajha Poll: Who is your favorite Nepali actress?
Do nepalese really need TPS?
Problems of Nepalese students in US
nrn citizenship
TPS EAD auto extended to June 2025 or just TPS?
Nas and The Bokas: Coming to a Night Club near you
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
TPS Update : Jajarkot earthquake
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