×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Asc and Chr Functions

Asc and Chr Functions

Asc and Chr Functions

(OP)
Do the Asc function and Chr functions in VB exist in any way in FM6?

Swi

RE: Asc and Chr Functions

In FM6 you need a calculation to generate the values.

In FM +6, you can make a custom function.

RE: Asc and Chr Functions

(OP)
I have been reading books and some online tutorials but have not used the actual product yet.  I will be using it for the first time next week.  I was looking into calculations but could not find anything that correlated to the Asc and Chr functions in VB.  Thanks for the info.

Swi

RE: Asc and Chr Functions

See
http://www.nightwing.com.au/FileMaker/demos2.html

scroll down untill ASCII to have a demo.
Again, this is for FM6, or you have to use a plug-in, like one from Troi.

In FM7 and up, a custom function can generate the same results.

...and I don-t remember what the CHR does....

RE: Asc and Chr Functions

(OP)
Thanks.  I will look into it.

Swi

RE: Asc and Chr Functions

(OP)
That is great.  The Chr function converts the specified ANSI character code to a character.

Swi

RE: Asc and Chr Functions

(OP)
Again, that link you provided should work but what I am trying to accomplish is recreating the following VB code:

CODE

Public Function Bar128AB(BarTextIn As String, Subset As Integer) As String

' Initialize input and output strings
BarTextOut = ""
BarTextIn = RTrim(LTrim(BarTextIn))

' Set up for the subset we are in
If Subset = 0 Then
  Sum = 103
  StartChar = "{"
Else
  Sum = 104
  StartChar = "|"
End If

' Calculate the checksum, mod 103 and build output string
For II = 1 To Len(BarTextIn)
  'Find the ASCII value of the current character
  ThisChar = (Asc(Mid(BarTextIn, II, 1)))
  'Calculate the bar code 128 value
  If ThisChar < 127 Then
    CharValue = ThisChar - 32
  Else
    CharValue = ThisChar - 103
  End If
  'add this value to sum for checksum work
  Sum = Sum + (CharValue * II)

  'Now work on output string, no spaces in TrueType fonts, quotes replaced for Word mailmerge bug
  If Mid(BarTextIn, II, 1) = " " Then
    BarTextOut = BarTextOut & Chr(228)
  ElseIf Asc(Mid(BarTextIn, II, 1)) = 34 Then
    BarTextOut = BarTextOut & Chr(226)
  ElseIf Asc(Mid(BarTextIn, II, 1)) = 123 Then
    BarTextOut = BarTextOut & Chr(194)
  ElseIf Asc(Mid(BarTextIn, II, 1)) = 124 Then
    BarTextOut = BarTextOut & Chr(195)
  ElseIf Asc(Mid(BarTextIn, II, 1)) = 125 Then
    BarTextOut = BarTextOut & Chr(196)
  ElseIf Asc(Mid(BarTextIn, II, 1)) = 126 Then
    BarTextOut = BarTextOut & Chr(197)
  Else
    BarTextOut = BarTextOut & Mid(BarTextIn, II, 1)
  End If
Next II

' Find the remainder when Sum is divided by 103
CheckSumValue = (Sum Mod 103)
' Translate that value to an ASCII character
If CheckSumValue > 90 Then
  CheckSum = Chr(CheckSumValue + 103)
ElseIf CheckSumValue > 0 Then
  CheckSum = Chr(CheckSumValue + 32)
Else
  CheckSum = Chr(228)
End If

'Build ouput string, trailing space is for Windows rasterization bug
BarTempOut = StartChar & BarTextOut & CheckSum & "~ "

'Return the string
Bar128AB = BarTempOut
End Function

My question is, since I have not messed with FM6 much is can this function be recreated in FM6?

Swi

RE: Asc and Chr Functions

(OP)
This is the software that I requested the company to buy before I was coming there but unfortunately their IT consultant told them to buy something from Elfring fonts.  They only provide source code in VBA which is the above source code.

Swi

RE: Asc and Chr Functions

(OP)
The unfortunate thing is that I can not use IDAutomation's plugin with the fonts from Elfring per this link:

http://www.download32.com/info/34472.htm

They say the plugin must be used with one of their fonts.

Swi

RE: Asc and Chr Functions

I walked away from Elfring, what I used in my DBIII developer period, years ago,when I switched to FileMaker.

Sorry, can't help you here.
Back then Elfring was not compatible with FileMaker and they still not support FM.

For one of my customers I use the font from
http://www.peninsula-group.com/FMbar/Default.html

maybe that can help you....
And it supports Code 39 and 128

RE: Asc and Chr Functions

(OP)
Thanks.  I will look into it.  I would assume that you would use IDAutomation over the link above if you had a choice.  Thanks again.

Swi

RE: Asc and Chr Functions

For what I need, yes.

The whole productline of IDAutomation gives me all I need...for now.

RE: Asc and Chr Functions

(OP)
Thank you for all of the options.  Maybe I can talk them into buying one of the above packages.  Thanks.

Swi

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close