How to add special character _ in the middle of string? For example:
Dim x
x = "Smith"
I need to get output as: S_m_i_t_h
Or:
Option Explicit
' string concatenation (bad idea in languages with non-mutable strings)
Function f1(s)
Dim l : l = Len(s)
If 2 > l Then
f1 = s
Else
Dim p
f1 = Left(s, 1)
For p = 2 To l
f1 = f1 & "_" & Mid(s, p, 1)
Next
End If
End Function
' Array via Mid(), Join
Function s2a(s)
Dim l : l = Len(s)
ReDim a(l - 1)
Dim p
For p = 1 To l
a(p - 1) = Mid(s, p, 1)
Next
s2a = a
End Function
Function f2(s)
f2 = Join(s2a(s), "_")
End Function
' RegExp.Replace, Mid(,2) to get rid of first _
Function f3(s)
Dim r : Set r = New RegExp
r.Global = True
r.Pattern = "(.)"
f3 = Mid(r.Replace(s, "_$1"), 2)
End Function
Function qq(s)
qq = """" & s & """"
End Function
Dim s, t
For Each s In Split(" a ab abc abcd Smith")
WScript.Echo "-----", qq(s)
t = f1(s)
WScript.Echo " ", qq(t)
t = f2(s)
WScript.Echo " ", qq(t)
t = f3(s)
WScript.Echo " ", qq(t)
Next
output:
cscript 39814484.vbs
----- ""
""
""
""
----- "a"
"a"
"a"
"a"
----- "ab"
"a_b"
"a_b"
"a_b"
----- "abc"
"a_b_c"
"a_b_c"
"a_b_c"
----- "abcd"
"a_b_c_d"
"a_b_c_d"
"a_b_c_d"
----- "Smith"
"S_m_i_t_h"
"S_m_i_t_h"
"S_m_i_t_h"
try it
strString = "Smith"
strleng=Len(strString)
result=""
if strleng<2 then
result=strString
else
For i=1 To strleng
result= result& Mid(strString,i,1)
if i<>strleng then
result= result& "_"
end if
Next
end if
Related
In a text based game that I'm making with Ruby, I wanted to have multiple colors on a single line of text. The paint gem would only seem to work with two colors but I wanted more, so I looked up those terminal codes to manipulate the cursor position so I could move up a line and print a string in a new color.
Is there a more efficient way to do this? Here is the code for the buy function from the shop:
clr
draw_stats_main
shopbag = Game_DB.weapons_array
bagkeys = shopbag.keys
bagkeys.delete_if {|i| i == 0}
shopbag.each { |id, value|
if id != 0
if id >= 10
string1 = " (" + id.to_s + ")" + " " + value[0]
str1 = string1.size
else
string1 = " (" + id.to_s + ")" + " " + value[0]
str1 = string1.size
end
string2 = "ATTACK: #{value[1]}"; str2 = string2.size
string3 = "SPEED: #{value[2]}"; str3 = string3.size
string4 = "" if !value[3]
string4 = "TWO HANDED WEAPON" if value[3]
str3 = string3.size
pa "#{string1}"
pa "\033[1A \033[#{str1}C #{string2}", :red, :bright
pa "\033[1A \033[#{str1+str2+4}C #{string3}", :yellow, :bright if value[1] < 10
pa "\033[1A \033[#{str1+str2+str3+9}C #{string4}", :red if value[1] < 10
pa "\033[1A \033[#{str1+str2+3}C #{string3}", :yellow, :bright if value[1] > 10 && value[1] < 100
pa "\033[1A \033[#{str1+str2+str3+8}C #{string4}", :red if value[1] > 10 && value[1] < 100
pa "\033[1A \033[#{str1+str2+2}C #{string3}", :yellow, :bright if value[1] >= 100
pa "\033[1A \033[#{str1+str2+str3+7}C #{string4}", :red if value[1] >= 100
pa " >> Cost: #{value[4]}", :yellow
end
}
pa "#{Game_DB.tx(:other, 0)}"
pa "#{Game_DB.tx(:common, 22)}", :green, :bright
loop do
key = gets.chomp.to_i
if bagkeys.include?(key)
if #player.gold >= shopbag[key][4]
#player.remove_gold(shopbag[key][4])
#player.add_item(:weapon, key)
weap = shopbag[key][0]; weapstr = weap.delete " "
pa "#{Game_DB.tx(:other, 0)}"
pa " You purchased #{weapstr} for #{shopbag[key][4]} gold! Dont forget to equip it!", :green, :bright
key = gets
break
else
pa " You don't have enough gold!", :red
key = gets
break
end
elsif key == 0
#shopmenu[0] = false
break
end
end
Here is a screenshot of what the player sees with this block of code: Weapons Shop screenshot
Trying to create a ceaser cipher in Ruby.
The problem I'm facing is that when the program reaches the while loop, it only performs the desired operation on the very last letter of the inputted word. Before I delve further into what I've tried, please find the code:
#!/usr/bin/ruby
#print 65.chr ASCII code for A
#print 97.chr ASCII code for a
a = 0
b = 97
d = []
e = 0
# Just to print the alphabet alongside the ASCII value
# (For sanity checking)
while a <= 25
print b.chr + " "
print b.to_s + "\n"
a = a + 1
b = b + 1
end
puts "\n Please enter a word to translate"
word = gets.strip
# The desired effect is to move the letter along by key value
puts "Please enter a key"
k = gets.chomp.to_i
# In its current state, what happens is only the last char
# is moved along by the key value.
while e <= word.length
word.each_byte do |c|
d[e] = c + k
end
e = e + 1
end
puts d
I'm thinking that the problem lies with the logic for the while loop. The way I am going to attack this is by reading the pre-converted word into an array, as opposed to using the .each_byte object.
I don't know how to do that and the guides/questions I've found don't quite answer the question. If anyone knows how to do this, or knows a better way of solving this- I'd be much appreciative.
you don't need the last while loop
word.each_byte do |c|
d[e] = c + k
e = e + 1
end
Something a bit more verbose:
alphabet = ('a'..'z').to_a
new_word = ''
puts "\n Please enter a word to translate"
word = gets.strip
puts "Please enter a key"
k = gets.chomp.to_i
word.split('').each_with_index do |letter, index|
alphabet_index = alphabet.index(letter)
new_index = alphabet_index + key
new_word[index] = alphabet[new_index]
end
puts "Your translated word is #{new_word}"
Caesar cipher is a simple shift cipher
word.each_byte do |c|
p c + k
end
Managed to get it working, thanks for all the help... Code for anyone interested:
#!/usr/bin/ruby
#print 65.chr A
#print 97.chr a
a = 0
b = 65
y = 97
d = []
e = 0
while a <= 25
print y.chr + " = " + y.to_s + " "
print b.chr + " = " + b.to_s + " " + "\n"
a = a + 1
b = b + 1
y = y + 1
end
puts "\n Please enter a word to translate"
word = gets.strip
puts "Please enter a key"
k = gets.chomp.to_i
word.each_byte do |c|
d[e] = c + k
e = e + 1
end
print "\n"
a = 0
arlen = d.count
while a != arlen
print d[a].chr
a = a + 1
end
print k
I want to read in a partly unspaced text file like this:
(I've had to make the lines double-spaced for ease of reading on this web page.
My problem is with the spacing between the "words", not the lines)
O0377(NO EXTRA SPACES REQUIRED INSIDE ALL PARENTHESES)
(T1 WNMG R0.8)
(T2 TNMG R0.8 SKEWED OUT)
(T3 3MM P/BLADE)
(T5 16MM U/DRILL CUTTING 16.5)
(CYCLE TIME 1MIN 5SEC)
G50S3000
G30U0W0M8(ROUGH OD AND FACE)
T0101
(NO EXTRA SPACES REQUIRED INSIDE SQUARE BRACKETS)
[IF#100GT#101GOTO99]
G96G99S180M3
G0X48.2Z20.
Z3.
N99G1Z-6.2F0.2
X12.F0.3
G30W0M24
M30
and then add a space before every letter, except inside parentheses - these are already spaced - and except inside square brackets - no spaces needed there.
It should look like this:
O0377(NO EXTRA SPACES REQUIRED INSIDE ALL PARENTHESES)
(T1 WNMG R0.8)
(T2 TNMG R0.8 SKEWED OUT)
(T3 3MM P/BLADE)
(T5 16MM U/DRILL CUTTING 16.5)
(CYCLE TIME 1MIN 5SEC)
G50 S3000
G30 U0 W0 M8 (ROUGH OD AND FACE)
T0101
(NO EXTRA SPACES REQUIRED INSIDE SQUARE BRACKETS)
[IF#100GT#101 GOTO99]
G96 G99 S180 M3
G0 X48.2 Z20.
Z3.
N99 G1 Z-6.2 F0.2
X12. F0.3
G30 W0 M24
M30
My problem is that my program puts spaces everywhere, like this:
O0377 ( N O E X T R A S P A C E S R E Q U I R E D I N S I D E A L L P A R E N T H E S E S)
( T1 W N M G R0.8)
( T2 T N M G R0.8 S K E W E D O U T)
( T3 3 M M P/ B L A D E)
( T5 16 M M U/ D R I L L C U T T I N G 16.5)
( C Y C L E T I M E 1 M I N 5 S E C)
G50 S3000
G30 U0 W0 M8 ( R O U G H O D A N D F A C E)
T0101
( N O E X T R A S P A C E S R E Q U I R E D I N S I D E S Q U A R E B R A C K E T S)
[ I F#100 G T#101 G O T O99]
G96 G99 S180 M3
G0 X48.2 Z20.
Z3.
N99 G1 Z-6.2 F0.2
X12. F0.3
G30 W0 M24
M30
This is my code. (Don't know how to make it all look like code...)
It's not pretty, but I can understand it, and it doesn't take long to process a typical file.
Private Sub Form_Load()
Dim InputLines, NextLine, OutputLines As String
Dim fileIn, fileOut As Integer
fileIn = FreeFile
Open "C:\Documents and Settings\Owner\Desktop\FileToBeSpaced.txt" For Input As fileIn
fileOut = FreeFile
Open "C:\Documents and Settings\Owner\Desktop\SpacedFile.txt" For Append As fileOut
Do While Not EOF(fileIn)
Line Input #fileIn, NextLine
InputLines = InputLines + NextLine + Chr(13) + Chr(10)
OutputLines = InputLines
OutputLines = Replace(OutputLines, "A", " A")
OutputLines = Replace(OutputLines, "B", " B")
OutputLines = Replace(OutputLines, "C", " C")
OutputLines = Replace(OutputLines, "D", " D")
OutputLines = Replace(OutputLines, "E", " E")
OutputLines = Replace(OutputLines, "F", " F")
OutputLines = Replace(OutputLines, "G", " G")
OutputLines = Replace(OutputLines, "H", " H")
OutputLines = Replace(OutputLines, "I", " I")
OutputLines = Replace(OutputLines, "J", " J")
OutputLines = Replace(OutputLines, "K", " K")
OutputLines = Replace(OutputLines, "L", " L")
OutputLines = Replace(OutputLines, "M", " M")
OutputLines = Replace(OutputLines, "N", " N")
OutputLines = Replace(OutputLines, "O", " O")
OutputLines = Replace(OutputLines, "P", " P")
OutputLines = Replace(OutputLines, "Q", " Q")
OutputLines = Replace(OutputLines, "R", " R")
OutputLines = Replace(OutputLines, "S", " S")
OutputLines = Replace(OutputLines, "T", " T")
OutputLines = Replace(OutputLines, "U", " U")
OutputLines = Replace(OutputLines, "V", " V")
OutputLines = Replace(OutputLines, "W", " W")
OutputLines = Replace(OutputLines, "X", " X")
OutputLines = Replace(OutputLines, "Y", " Y")
OutputLines = Replace(OutputLines, "Z", " Z")
OutputLines = Replace(OutputLines, "(", " (")
Loop
Print #fileOut, OutputLines
Close fileIn
Close fileOut
Unload frmInsertSpaces
End Sub
The "word" spacing is the main issue. I want to avoid unnecessary extra spaces.
And then, obviously I don't want to have to work with a fixed path and filename, like I have in my code at the moment.
I'd like to just drop any unspaced file onto an icon or something, and have it spaced, and automatically saved to the desktop. Or even right-click an unspaced file, and do it from there.
If anyone can provide a (preferably uncomplicated) solution, or point me in the right direction, I'd be very grateful. Thanks in advance, Pete.
Pretty routine stuff really.
This ought to be close if not precisely what you want. Try to follow the code, which uses an "inline string builder" technique to avoid concatenation performance bottlenecks. This sort of thing is needed so often you ought to become familiar with the approach rather than just copy/pasting code handouts.
Because of your title and poor problem description above I despair of any future reader ever discovering this and applying it to other problems though.
Option Explicit
Private Sub Main()
Dim InpF As Integer 'Input file number.
Dim InpText As String 'Input line of text.
Dim InpP As Long 'Input "pointer" within line.
Dim NewF As Integer
Dim NewText As String
Dim NewP As Long
Dim Char As String
Dim EndB As String 'End bracket character.
Dim TempP As Long
Dim Length As Long 'Length of bracketed text.
InpF = FreeFile(0)
Open "original.txt" For Input As #InpF
NewF = FreeFile(0)
Open "new.txt" For Output As #NewF
Do Until EOF(InpF)
Line Input #InpF, InpText
NewText = Space$(Len(InpText) * 3 \ 2) 'Allocate estimated space.
NewP = 1
For InpP = 1 To Len(InpText)
Char = Mid$(InpText, InpP, 1)
If Char = "(" Or Char = "[" Then
If Char = "(" Then EndB = ")" Else EndB = "]"
TempP = InStr(InpP + 1, InpText, EndB)
If TempP = 0 Then TempP = Len(InpText)
Length = TempP - InpP + 1
If Len(NewText) < NewP + Length - 1 Then
NewText = NewText & Space$(Length) 'Add more space.
End If
Mid$(NewText, NewP, Length) = Mid$(InpText, InpP, Length)
InpP = InpP + Length
NewP = NewP + Length
Else
If Char Like "[A-Z]" And InpP > 1 Then NewP = NewP + 1
If Len(NewText) < NewP + 2 Then
NewText = NewText & Space$(10) 'Add more space.
End If
Mid$(NewText, NewP) = Char
NewP = NewP + 1
End If
Next
Print #NewF, Left$(NewText, NewP - 1)
Loop
Close #NewF
Close #InpF
End Sub
hey everyone i'm trying to create ttt and it works but when i do a test run and i make a player win, the last character doesn't show. if it's supposed to be 3 X's or O's aligned, the computer will recognize the winning move and declare a winner but btnclicked.text s still = nothing. here's my code, i have no idea how to fix it and because of that, the if statements that would recognize a draw and produce an output an't be evaluated.
Private Sub btnMoveMade_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles _
btn00.Click, btn01.Click, btn02.Click, btn10.Click, btn11.Click, btn12.Click, btn20.Click,
btn21.Click, btn22.Click
Dim btnSquareClicked As Button = sender
Dim player1 As String = Me.txtName1.Text
Dim player2 As String = Me.txtname2.Text
Static chrTTT(2, 2) As Char
Static player As String = "X"
If btnSquareClicked.Text <> Nothing Then
MessageBox.Show("Invalid Move.")
Else
Dim index As String
index = btnSquareClicked.Tag
Dim x As Integer = Val(index.Chars(0))
Dim y As Integer = Val(index.Chars(1))
Call StoreMove(x, y, player, chrTTT)
If IsWinner(chrTTT) Then
player = player1
MessageBox.Show(player & "!, Congratulations, You Won!")
btnNewGame.Visible = True
ElseIf IsWinner2(chrTTT) Then
player = player2
MessageBox.Show(player & "!, Congratulations, You won!")
btnNewGame.Visible = True
ElseIf btn00.Text <> Nothing And btn01.Text <> Nothing And btn02.Text <> Nothing And btn10.Text <> Nothing And btn11.Text <> Nothing _
And btn12.Text <> Nothing And btn20.Text <> Nothing And btn21.Text <> Nothing _
And btn22.Text <> Nothing And IsWinner(chrTTT) = False And IsWinner2(chrTTT) = False Then
MessageBox.Show("Aww, it's a draw")
Else
If player = "X" Then
player = "O"
btnSquareClicked.Text = "X"
Else
player = "X"
btnSquareClicked.Text = "O"
End If
End If
End If
End Sub
Sub StoreMove(ByVal x As Integer, ByVal y As Integer, ByVal player As Char, ByRef TTT(,) As Char)
TTT(x, y) = player
End Sub
Function IsWinner(ByRef TTT(,) As Char) As Boolean
For row As Integer = 0 To 2
If TTT(row, 0) = TTT(row, 1) And TTT(row, 1) = TTT(row, 2) And TTT(row, 0) = "X" Then
Return True
End If
Next row
For col As Integer = 0 To 2
If TTT(0, col) = TTT(1, col) And TTT(1, col) = TTT(2, col) And TTT(0, col) = "X" Then
Return True
End If
Next col
If TTT(0, 0) = TTT(1, 1) And TTT(1, 1) = TTT(2, 2) And TTT(0, 0) = "X" Then
Return True
End If
If TTT(0, 2) = TTT(1, 1) And TTT(1, 1) = TTT(2, 0) And TTT(0, 2) = "X" Then
Return True
End If
Dim movesLeft As Boolean = False
For row As Integer = 0 To 2
For col As Integer = 0 To 2
If TTT(row, col) = Nothing Then
movesLeft = True
End If
Next col
Next row
If Not movesLeft Then
Return True
End If
Return False
End Function
Function IsWinner2(ByRef TTT(,) As Char) As Boolean
For row As Integer = 0 To 2
If TTT(row, 0) = TTT(row, 1) And TTT(row, 1) = TTT(row, 2) And TTT(row, 0) = "O" Then
Return True
End If
Next row
For col As Integer = 0 To 2
If TTT(0, col) = TTT(1, col) And TTT(1, col) = TTT(2, col) And TTT(0, col) = "O" Then
Return True
End If
Next col
If TTT(0, 0) = TTT(1, 1) And TTT(1, 1) = TTT(2, 2) And TTT(0, 0) = "O" Then
Return True
End If
If TTT(0, 2) = TTT(1, 1) And TTT(1, 1) = TTT(2, 0) And TTT(0, 2) = "O" Then
Return True
End If
Dim movesLeft As Boolean = False
For row As Integer = 0 To 2
For col As Integer = 0 To 2
If TTT(row, col) = Nothing Then
movesLeft = True
End If
Next col
Next row
If Not movesLeft Then
Return True
End If
Return False
End Function
End Class
Set the Button Text before you do anything else:
If btnSquareClicked.Text <> Nothing Then
MessageBox.Show("Invalid Move.")
Else
btnSquareClicked.Text = player
' ... rest of the code ...
End If
thanks a lot, i just tried it and it worked, but the the message box that is suppose to show when it's a draw till doesn't come up, instead it still tells me that one of the players won
ElseIf btn00.Text <> Nothing And btn01.Text <> Nothing And btn02.Text <> Nothing And btn10.Text <> Nothing And btn11.Text <> Nothing _
And btn12.Text <> Nothing And btn20.Text <> Nothing And btn21.Text <> Nothing _
And btn22.Text <> Nothing And IsWinner(chrTTT) = False And IsWinner2(chrTTT) = False Then
MessageBox.Show("Aww, it's a draw")
that's the section dedicated to checking for a draw.
I'm playing around with the new yahoo API. I'd like to scrap some dummy data using the following address
http://query.yahooapis.com/v1/public/yql?q=desc%20social.updates.search&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=cbfunc
When I run this I get an authenticaion error (Need to be logged into Yahoo) This is fine obviously for me messing around on the internet. However I'd like to call this from a ruby script. Any ideas how I go about authenticating? I can only seem to find some web enabled version.
You might try the Mechanize gem for this. I've used it for other authenticated services
in the past.
I'd also recomment httparty -- It is ridiculously easy to map JSON services with this. Try this:
require 'rubygems'
require 'httparty'
class Yahoo
include HTTParty
# i don't think you need auth for this endpoint -- but if you do, uncomment below and fill it in
#basic_auth 'username', 'password'
format :json
def self.load
self.get 'http://query.yahooapis.com/v1/public/yql', :query => {:q => 'desc social.updates.search', :format => 'json', :diagnostics => true, :env => 'store://datatables.org/alltableswithkeys'}
end
end
puts Yahoo.load
You could try omniauth-yahoo for authorization, but it's seen didn't support get the new token after expired.
Public Function ScanColumns(SheetName As String, thisMany As Double, ShowWhat As String)
e = 0
For a = 1 To thisMany
aa = Application.WorksheetFunction.CountA(Sheets(SheetName).Cells(1, a).EntireColumn)
If aa > 0 Then
r = a
If e = 0 Then
e = a
End If
End If
Next a
If ShowWhat = "MIN" Then
ScanColumns = e
End If
If ShowWhat = "MAX" Then
ScanColumns = r
End If
End Function
Public Function ScanRows(SheetName As String, thisMany As Double, ShowWhat As String)
e = 0
For a = 1 To thisMany
aa = Application.WorksheetFunction.CountA(Sheets(SheetName).Cells(a, 1).EntireRow)
If aa > 0 Then
r = a
If e = 0 Then
e = a
End If
End If
Next a
If ShowWhat = "MIN" Then
ScanRows = e
End If
If ShowWhat = "MAX" Then
ScanRows = r
End If
End Function
Public Function FindInArea(SheetName As String, startRow As String, endRow As String, startCol As String, endCol As String, FindThis As String, ShowWhat As String)
CalendarMonthFormat1 = "Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,"
CalendarMonthFormat2 = "January, Feburary,March,April,May,June,July,August,September,October,November,December,"
earliestDate = 999999999
latestDate = 0
If Left(FindThis, 7) = "[LENGTH" Then
LengthLook = Replace(FindThis, "[LENGTH", "")
LengthLook = Replace(LengthLook, "]", "")
End If
For a = startRow To endRow
For b = startCol To endCol
ThisCell = Sheets(SheetName).Cells(a, b)
thisCellAddr = Sheets(SheetName).Cells(a, b).Address
If ThisCell = FindThis Then
addrList = addrList & "[" & thisCellAddr & "]"
rc_list = rc_list & "[" & a & "," & b & "]"
c = c + 1
End If
If FindThis = "[MONTHS1]" Then
If ThisCell <> "" And InStr(LCase(CalendarMonthFormat1), LCase((ThisCell) & ",")) > 0 And Len(ThisCell) = 3 Then
addrList = addrList & "[" & thisCellAddr & "]"
rc_list = rc_list & "[" & a & "," & b & "]"
c = c + 1
End If
End If
If FindThis = "[MONTHS2]" Then
If ThisCell <> "" And InStr(LCase(CalendarMonthFormat2), LCase((ThisCell) & ",")) > 0 Then
addrList = addrList & "[" & thisCellAddr & "]"
rc_list = rc_list & "[" & a & "," & b & "]"
c = c + 1
End If
End If
If FindThis = "[DATEFORMAT]" Then
If InStr(ThisCell, "/") > 0 Then
slash_count = 0
For sc = 1 To Len(ThisCell)
If Mid(ThisCell, sc, 1) = "/" Then
slash_count = slash_count + 1
End If
Next sc
If slash_count = 2 Then
On Error Resume Next
D = Day(ThisCell)
M = Month(ThisCell)
Y = Year(ThisCell)
If D > 0 And M > 0 And Y > 0 Then
addrList = addrList & "[" & thisCellAddr & "]"
rc_list = rc_list & "[" & a & "," & b & "]"
c = c + 1
If earliestDate > DateValue(ThisCell) Then
earliestDate = DateValue(ThisCell)
If Len(D) = 1 Then
D = "0" & D
End If
If Len(M) = 1 Then
M = "0" & M
End If
eDateLocation = thisCellAddr
eDate_Format = D & "-" & M & "-" & Y
End If
If latestDate < DateValue(ThisCell) Then
latestDate = DateValue(ThisCell)
If Len(D) = 1 Then
D = "0" & D
End If
If Len(M) = 1 Then
M = "0" & M
End If
lDateLocation = thisCellAddr
lDate_Format = D & "-" & M & "-" & Y
End If
End If
End If
End If
End If
If Left(FindThis, 7) = "[LENGTH" Then
If Len(ThisCell) = Val(LengthLook) Then
addrList = addrList & "[" & thisCellAddr & "]"
rc_list = rc_list & "[" & a & "," & b & "]"
c = c + 1
End If
End If
If FindThis = "[DECIMAL]" Then
If InStr((ThisCell), ".") > 0 Then
addrList = addrList & "[" & thisCellAddr & "]"
rc_list = rc_list & "[" & a & "," & b & "]"
c = c + 1
End If
End If
If FindThis = "[PERC]" Then
If InStr((ThisCell), ".") > 0 And ThisCell <> "" And ThisCell <> 0 And Val(ThisCell) >= -1 And Val(ThisCell) <= 1 Then
addrList = addrList & "[" & thisCellAddr & "]"
rc_list = rc_list & "[" & a & "," & b & "]"
c = c + 1
End If
End If
Next b
Next a
If ShowWhat = "COUNT" Then
FindInArea = c
End If
If ShowWhat = "ADDR" Then
FindInArea = addrList
End If
If ShowWhat = "RC" Then
FindInArea = rc_list
End If
If ShowWhat = "EARLIESTDATE" Then
FindInArea = eDate_Format
End If
If ShowWhat = "EARLIESTDATEADDR" Then
FindInArea = eDateLocation
End If
If ShowWhat = "LATESTDATE" Then
FindInArea = lDate_Format
End If
If ShowWhat = "LATESTDATEADDR" Then
FindInArea = lDateLocation
End If
End Function