Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 994921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:38:30+00:00 2026-05-16T06:38:30+00:00

guess its getting late, and Im a beginner, just need a little help.. Im

  • 0

guess its getting late, and Im a beginner, just need a little help..

Im trying to find the length of a list.. BUT NOT of the lists themselves, rather the length of the values within..

I take something like:

   Other = [<<"366">>,0,
             <<1>>,
             <<"344">>,<<"Really"
             <<1>>,
             <<"989">>,<<"NotReally">>
             <<1>>,
             <<"345">>,4,
             <<1>>,
             <<"155">>,"209.191"]

I would really want to first convert Other into its RAW constituent binary

Example:

Other = [<<3>>,<<4>>,<<7>>,<<56>>,<<45>>,<<56>>...]

This, of course, is an example of way the original Other would look like(Not right conversion values). So that all of the values in there are there most basic binary data.

Then I could simply iterate through counting each <<_>> and determining the total message length.

Hope I was clear enough to find a solution.

Thanks all for the help, GN

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:38:32+00:00Added an answer on May 16, 2026 at 6:38 am

    If all you’re trying to do is find the length of the entire structure, I’d try something like this:

    my_length(X) when is_integer(X) -> 1;
    my_length(X) when is_binary(X) -> erlang:size(X);
    my_length(Lst) when is_list(Lst) ->
        lists:sum([my_length(X) || X <- Lst]).
    

    If you really want to build a flat version of your structure, then erlang:list_to_binary gets you pretty close to what you need, then just call size on that. (Actually, this may be better than my first attempt.)

    1> erlang:list_to_binary([<<"366">>,0,<<"155">>,"209.191"]).
    <<51,54,54,0,49,53,53,50,48,57,46,49,57,49>>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On Windows Mobile (but I guess it's the same on Windows) in a native
I guess I'm really after an aid to help people who forget, Cruise Control
I guess the topic says it. I have tried googling this, but havent gotten
I dont know what to do anymore... its hopeless. I'm getting tired of guessing
Nant seems very compiler-centric - which is guess is because it's considered a .NET
My guess is that class variables (class var) are truly global in storage (that
I guess this is an odd one, and the answer is most likely it
I guess the real question is: If I don't care about dirty reads, will
I guess I'll illustrate with an example: In this game you are able to
I guess it should be a common technique, However, I tried the following two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.